summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Fix ClangParserTest.cppPavel Labath2018-06-051-1/+1
| | | | | | | The test does not use a test fixture, so it needs to be declared with the TEST macro. llvm-svn: 333992
* Protect DWARFCompileUnit::m_die_array by new mutexesJan Kratochvil2018-06-053-38/+134
| | | | | | | | | | | | | If BuildAddressRangeTable called ExtractDIEsIfNeeded(false), then another thread started processing data from m_die_array and then the first thread called final ClearDIEs() the second thread would crash. It is also required without multithreaded debugger using DW_TAG_partial_unit for DWZ. Differential revision: https://reviews.llvm.org/D40470 llvm-svn: 333987
* Fix Expression unittests on DarwinJonas Devlieghere2018-06-052-1/+4
| | | | | | Fixes the Expression unittests on Darwin after r333933 was landed. llvm-svn: 333974
* Add ClangHost.cpp to the Xcode project. Jim Ingham2018-06-052-0/+7
| | | | | | | Also add an include that was needed for the if APPLE branch of the function. llvm-svn: 333971
* Change SWIG output directory when building LLDB.framework with CMakeAlex Langford2018-06-042-3/+3
| | | | | | | | | | | Instead of assuming that SWIG generated files (e.g. lldb.py) will live in scripts, we should set it to $LLDB_PYTHON_TARGET_DIR. This variable is set to scripts, except when building LLDB.framework when it is set to LLDB_FRAMEWORK_DIR. Differential Revision: https://reviews.llvm.org/D47742 llvm-svn: 333968
* [lldb, lldb-mi] Enable lldb-mi -break-insert test on Windows.Alexander Polyakov2018-06-041-5/+4
| | | | | | | | | | | | | | | | | Summary: The default name for a compiler output on Linux is `a.out`, while on Windows it's `a.exe`. But if we add option `-o a.exe`, the compiler will create the executable `a.exe` on the both systems. Reviewers: aprantl, stella.stamenova Reviewed By: stella.stamenova Subscribers: ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47679 llvm-svn: 333963
* Remove dependency from Host to clang.Zachary Turner2018-06-0414-187/+253
| | | | | | | | | | Host depended on clang because HostInfo had a function to get the directory where clang was installed. We move this over to the clang expression parser plugin where it's more at home. Differential Revision: https://reviews.llvm.org/D47384 llvm-svn: 333933
* [IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commandsVedant Kumar2018-06-044-341/+355
| | | | | | | | | | | | | | | | Change the syntax of the malloc and free commands in lldb-test's ir-memory-map subcommand to: <malloc> ::= <label> = malloc <size> <alignment> <free> ::= free <label> This should make it easier to read and extend tests in the future, e.g to test IRMemoryMap::WriteMemory or double-free behavior. Differential Revision: https://reviews.llvm.org/D47646 llvm-svn: 333930
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-041-0/+10
| | | | | | OpenBSD python module. llvm-svn: 333889
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-042-15/+23
| | | | | | | | | | | | Add OpenBSD python module in order to support unit tests. Reviewers: labath, zturner Reviewed By: labath Differential Revision: https://reviews.llvm.org/D47692 llvm-svn: 333888
* AppleDWARFIndex: Get function method-ness directly from debug infoPavel Labath2018-06-045-64/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When searching for methods only, we need to do extra work to make sure the functions we get from the apple tables are indeed methods. Previously we were resolving the DIE into a SymbolContext and then checked whether the enclosing CompilerDeclContext is a class (or struct, or union). This patch changes that to operate on the debug info directly. This should be: - simpler - faster - more consistent with the ManualDWARFIndex (which does the same check, only at indexing time). What we lose this ways is for the language plugin to have a say in what it considers to be a "class", but that's probably more flexibility than we need (and if we really wanted to do that in the future, we could implement a more direct way to consult the plugin about this). This also fixes the find-method-local-struct test, which was failing because we were not able to construct a CompilerDeclContext for a local struct correctly. As a drive-by, I rename the DWARFDIE's IsStructClassOrUnion method to match the name on the CompilerDeclContext class. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47470 llvm-svn: 333878
* Python: adjust the include directoriesSaleem Abdulrasool2018-06-041-6/+5
| | | | | | | Restructure the include search order to adjust for libedit. This ensures that the variables are not unused if they are not defined. llvm-svn: 333863
* [lldb, lldm-mi] Fix hanging of -exec-run command.Alexander Polyakov2018-06-033-0/+20
| | | | | | | | | | | | | | Summary: -exec-run command hanged in case of invalid or dummy target. Reviewers: aprantl, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47678 llvm-svn: 333844
* Test commit. Fix typo in comment.Alexander Polyakov2018-06-031-1/+1
| | | | llvm-svn: 333837
* Fix silly error introduced after testing in r333813.James Y Knight2018-06-021-7/+0
| | | | | | Oops. llvm-svn: 333816
* Fix support for distinguishing archive members by timestamp on Darwin.James Y Knight2018-06-027-3/+136
| | | | | | | | | | | | | | | | | | | On Darwin, the binary's symbol table points to debug info in object files -- potentially object files within a static library. Such a library may have multiple entries with the same name, distinguished only by timestamp. The code was already _attempting_ to handle this case (see the code in ObjectContainerBSDArchive::Archive::FindObject which disambiguates via timestamp). But, unfortunately, while the timestamp was taken into account on the _first_ lookup, the result was then cached in a map keyed only off of the path. Added the timestamp to the cache, and added a test case. Differential Revision: https://reviews.llvm.org/D47660 llvm-svn: 333813
* [lit, pdb] Fix two failing PDB tests on WindowsStella Stamenova2018-06-012-8/+8
| | | | | | | | | | | | | | Summary: One of the tests is failing to build because it needs GS-, the second test does not correctly match all the expected function names because newer DIA SDKs annotate the function names with their return type and inputs (e.g. "static long `anonymous namespace'::StaticFunction(int)") Reviewers: asmith, zturner Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47653 llvm-svn: 333790
* [lit, lldbmi] Skip the new break-insert test on WindowsStella Stamenova2018-06-011-0/+4
| | | | | | | | | | | | | | Summary: Skip the new break-insert test on Windows because it hangs and so the test suite never completes. All other lldb-mi tests in the test suite are also skipped on windows Reviewers: asmith, aprantl, polyakov.alex Reviewed By: aprantl Subscribers: ki.stfu, llvm-commits Differential Revision: https://reviews.llvm.org/D47651 llvm-svn: 333789
* XFAIL TestIRMemoryMap.test on WindowsVedant Kumar2018-06-011-1/+1
| | | | | | | | I've xfailed this test instead of skipping it by request (https://reviews.llvm.org/D47646). Bug: https://bugs.llvm.org/show_bug.cgi?id=37656 llvm-svn: 333787
* Fix Module::FindTypes to return the correct number of matches.Frederic Riss2018-06-016-0/+43
| | | | | | | | | | | | | | | | | | | | | | In r331719, I changed Module::FindTypes not to limit the amount of types returned by the Symbol provider, because we want all possible matches to be able to filter them. In one code path, the filtering was applied to the TypeList without changing the number of types that gets returned. This is turn could cause consumers to access beyond the end of the TypeList. This patch fixes this case and also adds an assertion to TypeList::GetTypeAtIndex to catch those obvious programming mistakes. Triggering the condition in which we performed the incorrect access was not easy. It happened a lot in mixed Swift/ObjectiveC code, but I was able to trigger it in pure Objective C++ although in a contrieved way. rdar://problem/40254997 llvm-svn: 333786
* Disable TestIRMemoryMap.test on WindowsVedant Kumar2018-06-011-0/+2
| | | | | | | It's been pointed out in https://reviews.llvm.org/D47646 that lldb-test fails to create a usable process on Windows when running this test. llvm-svn: 333785
* [lldb, process] Fix occasional hang when launching a process in LLDBStella Stamenova2018-06-013-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Occasionally, when launching a process in lldb (especially on windows, but not limited to), lldb will hang before the process is launched and it will never recover. This happens because the timing of the processing of the state changes can be slightly different. The state changes that are issued are: 1) SetPublicState(eStateLaunching) 2) SetPrivateState(eStateLaunching) 3) SetPublicState(eStateStopped) 4) SetPrivateState(eStateStopped) What we expect to see is: public state: launching -> launching -> stopped private state: launching -> stopped What we see is: public state: launching -> stopped -> launching private state: launching -> stopped The second launching change to the public state is issued when WaitForProcessStopPrivate calls HandlePrivateEvent on the event which was created when the private state was set to launching. HandlePrivateEvent has logic to determine whether to broadcase the event and a launching event is *always* broadcast. At the same time, when the stopped event is processed by WaitForProcessStopPrivate next, the function exists and that event is never broadcast, so the public state remains as launching. HandlePrivateEvent does two things: determine whether there's a next action as well as determine whether to broadcast the event that was processed. There's only ever a next action set if we are trying to attach to a process, but WaitForProcessStopPrivate is only ever called when we are launching a process or connecting remotely, so the first part of HandlePrivateEvent (handling the next action) is irrelevant for WaitForProcessStopPrivate. As far as broadcasting the event is concerned, since we are handling state changes that already occurred to the public state (and are now duplicated in the private state), I believe the broadcast step is unnecessary also (and in fact, it causes the hang). This change removes the call to HandlePrivateEvent from inside WaitForProcessStopPrivate. Incidentally, there was also a bug filed recently that is the same issue: https://bugs.llvm.org/show_bug.cgi?id=37496 Reviewers: asmith, labath, zturner, jingham Reviewed By: zturner, jingham Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47609 llvm-svn: 333781
* Add dependency on clang-headers when building LLDB.framework using CMakeAlex Langford2018-06-011-0/+3
| | | | | | | | | | | | | | | Summary: The LLDB.framework generated when building with CMake + Ninja/Make is completely missing the clang headers. Although the code to copy them exists, we don't even generate them unless we're building LLDB standalone. Reviewers: clayborg, labath, sas Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47612 llvm-svn: 333777
* Add .debug_names section glue codePavel Labath2018-06-017-0/+23
| | | | llvm-svn: 333743
* [lit] Remove the *.test suffix from two test inputsVedant Kumar2018-05-313-4/+4
| | | | | | | This prevents the test inputs from being marked as unsupported tests, due to their lack of RUN lines. llvm-svn: 333701
* [IRMemoryMap] Test interleaved Mallocs and FreesVedant Kumar2018-05-313-3/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new command to the ir-memory-map tester: free <allocation-index> The argument to free is an index which identifies which live allocation to free. Index 0 identifies the first live allocation in the address space, index 1 identifies the second, etc. where the allocations are sorted in increasing order. For illustrative purposes, assume malloc returns monotonically increasing addresses. Here are some examples of how free would work: Example 1 --------- malloc 16 1 malloc 32 1 free 1 //< Free the 32-byte allocation. free 0 //< Next, free the 16-byte allocation. Example 2 --------- malloc 16 1 malloc 32 1 free 0 //< Free the 16-byte allocation. free 0 //< Next, free the 32-byte allocation. llvm-svn: 333700
* [lldb-test] Make logging available to all subcommandsVedant Kumar2018-05-311-0/+3
| | | | llvm-svn: 333699
* [IRMemoryMap] Test host-side allocationsVedant Kumar2018-05-312-3/+11
| | | | | | | | r333583 introduced testing for IRMemoryMap's process-side allocations (eAllocationPolicyProcessOnly). This adds support for the host-side variety (eAllocationPolicyHostOnly). llvm-svn: 333698
* [IRMemoryMap] Fix the alignment adjustment in MallocVedant Kumar2018-05-314-33/+49
| | | | | | | | | | | | | | | | | | | | This prevents Malloc from allocating the same chunk of memory twice, as a byproduct of an alignment adjustment which gave the client access to unallocated memory. Prior to this patch, the newly-added test failed with: $ lldb-test ir-memory-map ... ir-memory-map-overlap1.test ... Command: malloc(size=64, alignment=32) Malloc: address = 0x1000cd080 Command: malloc(size=64, alignment=8) Malloc: address = 0x1000cd0b0 Malloc error: overlapping allocation detected, previous allocation at [0x1000cd080, 0x1000cd0c0) Differential Revision: https://reviews.llvm.org/D47551 llvm-svn: 333697
OpenPOWER on IntegriCloud