summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build error introduced in r334498Pavel Labath2018-06-121-2/+2
| | | | | | | | | | Some gcc versions (circa 4.9) do not accept initializing Expected objects containing a reference to a function from a function. Change the Expected object to contain function pointers to work around this. llvm-svn: 334501
* DWARFDebugNames: Implement last GetGlobalVariables overloadPavel Labath2018-06-123-3/+33
| | | | | | | This function implements the search for all global variables within a given compilation unit. llvm-svn: 334500
* lldb-test symbols: Add -file argument and the ability to dump global ↵Pavel Labath2018-06-124-73/+126
| | | | | | | | | | | | | | | variables in a file The motivation for this is to be able to Dwarf index ability to look up variables within a given compilation unit. It also fits in with the patch in progress at D47939, which will add the ability to look up funtions using file+line pairs. The verification of which lldb-test options can be used together was getting a bit unwieldy, so I moved the logic out into a separate function. llvm-svn: 334498
* lit/SymbolFile/DWARF: Simplify test RUN linesPavel Labath2018-06-128-22/+14
| | | | | | | Use -mllvm compiler argument to enable DWARF v5 accelerator tables instead of piping the IR through llc. llvm-svn: 334496
* Exempt some compilers from new static variable test.Jonas Devlieghere2018-06-121-8/+34
| | | | | | | | Apparently some compilers generate incomplete debug information which caused the updated test to fail. Therefore I've extracted the new check into a separate test case with the necessary decorators. llvm-svn: 334456
* [Test] Update static variable test.Jonas Devlieghere2018-06-111-4/+23
| | | | | | | | | | Before Pavel's change in r334181, we were printing too many global variables. This patch updates the test suite to ensure we don't regress again in the future. rdar://problem/29180927 llvm-svn: 334454
* Document how lldb uses the DBGSourcePathRemapping Jason Molenda2018-06-112-11/+14
| | | | | | | source path remapping src/dest path pairs with respect to the DBGVersion number in the plist. llvm-svn: 334442
* Add DebugNamesDWARFIndex.cpp.Jason Molenda2018-06-111-0/+6
| | | | llvm-svn: 334441
* Add a new SBTarget::LoadCore() overload which surfaces errors if the load failsLeonard Mosescu2018-06-114-67/+102
| | | | | | | | | | | | | There was no way to find out what's wrong if SBProcess SBTarget::LoadCore(const char *core_file) failed. Additionally, the implementation was unconditionally setting sb_process, so it wasn't even possible to check if the return SBProcess is valid. This change adds a new overload which surfaces the errors and also returns a valid SBProcess only if the core load succeeds: SBProcess SBTarget::LoadCore(const char *core_file, SBError &error); Differential Revision: https://reviews.llvm.org/D48049 llvm-svn: 334439
* Fix tuple getter in std unique pointer pretty-printerPavel Labath2018-06-113-0/+18
| | | | | | | | | | | | | Summary: Check case when _M_t child member is not present. Reviewers: labath, tberghammer Reviewed By: labath, tberghammer Differential Revision: https://reviews.llvm.org/D47932 Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com>. llvm-svn: 334411
* DWARFDebugNames: Fix lookup in dwo filesPavel Labath2018-06-113-9/+56
| | | | | | | | | | | | The getDIESectionOffset function is not correct for split dwarf files (and will probably be removed in D48009). This patch implements correct section offset computation for split and non-split compile units -- we first need to check if the referenced unit is a skeleton unit, and if it is, we add the die offset to the full unit base offset (as the full unit is the one which contains the die). llvm-svn: 334402
* Move VersionTuple from clang/Basic to llvm/SupportPavel Labath2018-06-111-5/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: This kind of functionality is useful to other project apart from clang. LLDB works with version numbers a lot, but it does not have a convenient abstraction for this. Moving this class to a lower level library allows it to be freely used within LLDB. Since this class is used in a lot of places in clang, and it used to be in the clang namespace, it seemed appropriate to add it to the list of adopted classes in LLVM.h to avoid prefixing all uses with "llvm::". Also, I didn't find any tests specific for this class, so I wrote a couple of quick ones for the more interesting bits of functionality. Reviewers: zturner, erik.pilkington Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D47887 llvm-svn: 334399
* Editline: make #include <codecvt> conditionalPavel Labath2018-06-111-0/+2
| | | | | | | | | My previous patch made this include unconditional. However, it seems it is not available everywhere. This patch makes us include it only in configurations we really need it, which should be enough to unblock the bots. llvm-svn: 334397
* [cmake] Detect presence of wide-char libedit at build timePavel Labath2018-06-114-14/+33
| | | | | | | | | | | | | | | | | Summary: Instead of hardcoding a list of platforms where libedit is known to have wide char support we detect this in cmake. The main motivation for this is attempting to improve compatibility with different versions of libedit, as the interface of non-wide-char functions varies slightly between versions. Reviewers: krytarowski, uweigand, jankratochvil, timshen, beanz Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47625 llvm-svn: 334393
* [lldb-mi] Re-implement MI -exec-step command.Alexander Polyakov2018-06-104-25/+53
| | | | | | | | | | | | | | Summary: Now -exec-step uses SB API instead of HandleCommand hack. Reviewers: aprantl, clayborg, labath, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47838 llvm-svn: 334364
* [lldb, lldb-mi] Re-implement MI -exec-continue command.Alexander Polyakov2018-06-093-34/+30
| | | | | | | | | | | | | | Summary: Now -exec-continue command uses SB API to resume target's process. Reviewers: aprantl, clayborg, labath Reviewed By: clayborg Subscribers: apolyakov, labath, ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47415 llvm-svn: 334350
* Remove more dead code from NativeProcessLinuxAlex Langford2018-06-081-14/+0
| | | | | | This should have been removed in r334333. llvm-svn: 334336
* Delete dead code in NativeProcessLinuxAlex Langford2018-06-081-149/+0
| | | | | | | As far as I can tell, this code has always been guarded by `#if 0`. If this is useful code, it can be added back. llvm-svn: 334333
* Delete some dead codeAlex Langford2018-06-083-186/+0
| | | | llvm-svn: 334320
* Fix DynamicRegisterInfo copying/moving issue.Tatyana Krasnukha2018-06-082-23/+51
| | | | | | | | | | | | | | | Summary: Default copy/move constructors and assignment operators leave wrong m_sets[i].registers pointers. Made the class movable and non-copyable (it's difficult to imagine when it needs to be copied). Reviewers: clayborg Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D47728 llvm-svn: 334282
* Fix TestMiExec.pyPavel Labath2018-06-081-2/+2
| | | | | | | r334215 changed the error message the tool prints for invalid thread arguments to -exec-next command. This adjust the test to match that. llvm-svn: 334279
* DebugNamesDWARFIndex: Implement regex version of the GetFunctions methodPavel Labath2018-06-085-13/+61
| | | | | | | | | This also fixes a bug where SymbolFileDWARF was returning the same function multiple times - this can happen if both mangled and demangled names match the regex. Other lookup lookup functions had code to handle this case, but it was forgotten here. llvm-svn: 334277
* DebugNamesDWARFIndex: Implement GetFunctions methodPavel Labath2018-06-087-72/+121
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements the non-regex variant of GetFunctions. To share more code with the Apple implementation, I've extracted the common filtering code from that class into a utility function on the DWARFIndex base class. The new implementation also searching the accelerator table multiple times -- previously it could happen that the apple table would return the same die more than once if one specified multiple search flags in name_type_mask. This way, I separate table iteration from filtering, and so we can be sure each die is inserted at most once. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47881 llvm-svn: 334273
* PDB support of function-level linking and splitted functionsAaron Smith2018-06-086-17/+126
| | | | | | | | | | | | | | | | | | | Summary: The patch adds support of splitted functions (when MSVC is used with PGO) and function-level linking feature. SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of compiled source files in the binary are continuous and don't intersect each other. The function creates LineSequence for each file and inserts it into LineTable, and implementation of last one relies on continuity of the sequence. But it's not always true when function-level linking enabled, e.g. in added input test file test-pdb-function-level-linking.exe there is xstring's std__basic_string_char_std__char_traits_char__std__allocator_char_____max_size (.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and main (.004548F0). To fix the problem this patch renews the sequence on each address gap. Reviewers: asmith, zturner Reviewed By: asmith Subscribers: aleksandr.urakov, labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47708 llvm-svn: 334260
* Added missing include to LoadedModuleInfoList.hRaphael Isemann2018-06-081-0/+1
| | | | | | | | Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D47923 llvm-svn: 334259
* [lldb-mi] Add overloaded method for setting an error.Alexander Polyakov2018-06-072-0/+20
| | | | | | | | | | | | Reviewers: aprantl, clayborg Reviewed By: clayborg Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47914 llvm-svn: 334245
* Remove commented out line from top-level CMakeLists.txtAlex Langford2018-06-071-1/+0
| | | | llvm-svn: 334225
* [FileSystem] Split up the OpenFlags enumeration.Zachary Turner2018-06-071-2/+2
| | | | | | | | | | | | | | | | | This breaks the OpenFlags enumeration into two separate enumerations: OpenFlags and CreationDisposition. The first controls the behavior of the API depending on whether or not the target file already exists, and is not a flags-based enum. The second controls more flags-like values. This yields a more easy to understand API, while also allowing flags to be passed to the openForRead api, where most of the values didn't make sense before. This also makes the apis more testable as it becomes easy to enumerate all the configurations which make sense, so I've added many new tests to exercise all the different values. llvm-svn: 334221
* Check for process_vm_readv using CheckSymbolExistsAlex Langford2018-06-071-8/+2
| | | | | | | | | Instead of checking if code compiles, I think it is a better to check if the symbol exists. This is simpler and should do the same thing. Differential Revision: https://reviews.llvm.org/D47897 llvm-svn: 334219
* [lldb-mi] Re-implement MI -exec-next command.Alexander Polyakov2018-06-073-6/+46
| | | | | | | | | | | | | | Summary: Now -exec-next command uses SB API for stepping over. Reviewers: aprantl, clayborg, stella.stamenova, labath Reviewed By: aprantl, clayborg, labath Subscribers: labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47797 llvm-svn: 334215
* [lit, windows] Disable a number of tests that are failing on WindowsStella Stamenova2018-06-0720-0/+39
| | | | | | | | | | | | | | Summary: They all correspond to bugs that are already logged and I've added the appropriate (or most appropriate) bug numbers. This leaves only a handful of failing tests. Reviewers: asmith, zturner, labath Reviewed By: zturner Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D47892 llvm-svn: 334210
* [Platform] Accept arbitrary kext variantsJonas Devlieghere2018-06-072-22/+43
| | | | | | | | | | | | | | | | | | | When loading kexts in PlatformDarwinKernel, we use the BundleID as the filename to to create shared modules. In GetSharedModule we call ExamineKextForMatchingUUID for any BundleID it finds that is a match, to see if the UUID is also a match. Until now we were using Host::ResolveExecutableInBundle which calls a CoreFoundation API to obtain the executable. However, it's possible that the executable has a variant suffix (e.g. foo_development) and these files were ignored. This patch replaces that call with logic that looks for all the binaries in the bundle. Because of the way ExamineKextForMatchingUUID works, it's fine to try to load executables that are not valid and we can just iterate over the list until we found a match. Differential revision: https://reviews.llvm.org/D47539 llvm-svn: 334205
* DIERef: move trivial constructors into the headerPavel Labath2018-06-072-9/+4
| | | | | | | | | This enables more inlining/optimization opportunities for a fairly critical class. NFCI llvm-svn: 334198
* DebugNamesDWARFIndex: Add type lookup suportPavel Labath2018-06-073-1/+21
| | | | | | | | This implements just one of the GetTypes overloads. The other is not testable from lldb-test so I'm leaving it unimplemented until I figure out what to do with testing. llvm-svn: 334190
* DebugNamesDWARFIndex: add namespace lookup supportPavel Labath2018-06-073-1/+21
| | | | llvm-svn: 334186
* DebugNamesDWARFIndex: Add support for partial indexesPavel Labath2018-06-075-18/+71
| | | | | | | | | | | | | | | | | | | | | Summary: It possible that a single module has indexed and non-indexed compile units. In this case, we can use the fast indexed lookup for the first ones and fall back to the manual index for the others. This patch implements this functionality by adding a units_to_avoid argument to the ManualDWARFIndex constructor. Any units present in that list will be ignored for the purposes of manual index. Individual DebugNamesDWARFIndex then always consult both the manual fallback index as well as the index in the .debug_names section. Reviewers: JDevlieghere, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47832 llvm-svn: 334185
* DebugNamesDWARFIndex: Add ability to lookup variablesPavel Labath2018-06-0711-31/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the ability to lookup variables to the DWARF v5 index class. During review we discovered an inconsistency between how the existing two indexes handle looking up qualified names of the variables: - manual index would return a value if the input string exactly matched the demangled name of some variable. - apple index ignored the context and returned any variable with the same base name. So, this patch also rectifies that situation: - it removes all context handling from the index classes. The GetGlobalVariables functions now just take a base name. For manual index, this meant we can stop putting demangled names into the variable index (this matches the behavior for functions). - context extraction is put into SymbolFileDWARF, so that it is common to all indexes. - additional filtering based on the context is also done in SymbolFileDWARF. This is done via a simple substring search, which is not ideal, but it matches what we are doing for functions (cf. Module::LookupInfo::Prune). Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47781 llvm-svn: 334181
* [LLDB] Unit tests / typo fixDavid Carlier2018-06-071-1/+1
| | | | | | removing unnecessary comma. llvm-svn: 334177
* [DWARF] Add (empty) DebugNamesDWARFIndex class and a setting to control its usePavel Labath2018-06-0610-23/+174
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the skeleton for implementing the DWARF v5 name index class. All of the methods are stubbed out and will be implemented in subsequent patches. The interesting part of the patch is the addition of a "ignore-file-indexes" setting to the dwarf plugin which enables a user to force using manual indexing path in lldb (for example as a debugging aid). I have also added a test that verifies that file indexes are used by default. Reviewers: JDevlieghere, clayborg, jingham Subscribers: mgorny, mehdi_amini, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47629 llvm-svn: 334088
* [lit] Do not run Python tests w/ LLDB_DISABLE_PYTHONMichal Gorny2018-06-063-0/+5
| | | | | | | | | | Skip all Python-based tests as unsupported when LLDB_DISABLE_PYTHON is enabled. Otherwise, those tests simply fail being unable to import lldb module. Differential Revision: https://reviews.llvm.org/D47812 llvm-svn: 334080
* Revert "PDB support of function-level linking and splitted functions"Pavel Labath2018-06-069-107/+0
| | | | | | This reverts commit r334030 because it adds a broken test. llvm-svn: 334076
* PDB support of function-level linking and splitted functionsAaron Smith2018-06-059-0/+107
| | | | | | | | | | | | | | | | | | | Summary: The patch adds support of splitted functions (when MSVC is used with PGO) and function-level linking feature. SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of compiled source files in the binary are continuous and don't intersect each other. The function creates LineSequence for each file and inserts it into LineTable, and implementation of last one relies on continuity of the sequence. But it's not always true when function-level linking enabled, e.g. in added input test file test-pdb-function-level-linking.exe there is xstring's std__basic_string_char_std__char_traits_char__std__allocator_char_____max_size (.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and main (.004548F0). To fix the problem this patch renews the sequence on each address gap. Reviewers: asmith, zturner Reviewed By: asmith Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47708 llvm-svn: 334030
* [lit, pdb] Fix func-symbols.test (on Windows)Stella Stamenova2018-06-051-36/+37
| | | | | | | | | | | | Summary: This test was failing sporadically on windows because the order in which the symbols are generated was different between builds. To fix the test, we need to run FileCheck twice - once for each set of symbols we want to verify. The test only runs on Windows. Reviewers: asmith, zturner, labath Subscribers: stella.stamenova, llvm-commits Differential Revision: https://reviews.llvm.org/D47746 llvm-svn: 334025
* DWARFIndex: more GetFunctions cleanupPavel Labath2018-06-057-63/+14
| | | | | | | This applies similar simplification as r334004, only it touches the regex version of the method. llvm-svn: 334012
* dotest: make inline tests compatible with -fPavel Labath2018-06-051-54/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is split off from D47265 where I needed to be able to invoke every test with -f. That patch is kinda dead now, but this part seems like a good cleanup anyway. The problem with inline tests was in the way we were adding methods to the class, which left them with an incorrect __name__ property. This prevented dotest from finding them with -f. I fix this with (what I think is) the correct way of dynamically creating classes -- passing the list of methods during type construction instead of fixing up the class afterwards. Among other things this has the advantage of not needing to do anything special for debug info variants. As our test method will be visible to the metaclass, it will automagically do the multiplication for us. Reviewers: JDevlieghere, aprantl, tberghammer Subscribers: eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D47579 llvm-svn: 334009
* Fix windows build broken by r334004Pavel Labath2018-06-051-1/+1
| | | | | | | The problem was a link error due to a missing =0 on an abstract method. Interestingly, this was not a problem for clang/linux. llvm-svn: 334006
* DWARFIndex: simplify GetFunctions methodsPavel Labath2018-06-056-175/+92
| | | | | | | | | | | | | | | | Now that Apple index determines method-ness straight from the debug info, we don't need to resolve the functions into SymbolContexts inside the Index classes. This removes the need for callback arguments and allows us to pull the common parts out of the two implementations of these functions back into the SymbolFileDWARF class. Reviewers: JDevlieghere, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47147 llvm-svn: 334004
* Really fix ClangParserTestPavel Labath2018-06-051-1/+9
| | | | | | | It turns out the test needs a fixture after all (to initialize HostInfo), so provide one that does that. llvm-svn: 334003
* Silence unhandled enums warning in ClangASTContext::GetEncodingIlya Biryukov2018-06-051-0/+9
| | | | | | | | | The warning started firing after r333923, which added new builtin types (fixed point types) into clang. This patch merely silences the warning to unblock our integrate, does not aim to support the new types in lldb. llvm-svn: 333999
* Fixup r333987Pavel Labath2018-06-052-2/+3
| | | | | | | - add #include <atomic> (fixes windows build) - remove std::move (fixes "using move prevents copy ellision" warnings) llvm-svn: 333996
OpenPOWER on IntegriCloud