summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [FileSystem] Fix typo in ProcessFreeBSDJonas Devlieghere2018-11-011-1/+1
| | | | llvm-svn: 345860
* [FileSystem] Fix Exists call sitesJonas Devlieghere2018-11-015-8/+13
| | | | | | | There were some calls left to Exists() on non-darwin platforms (Windows, Linux and FreeBSD) that weren't yet updated to use the FileSystem. llvm-svn: 345857
* [FileSystem] Remove Exists() from FileSpecJonas Devlieghere2018-11-0152-171/+178
| | | | | | | | | This patch removes the Exists method from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53845 llvm-svn: 345854
* [FileSystem] Remove ResolveExecutableLocation() from FileSpecJonas Devlieghere2018-11-0110-58/+50
| | | | | | | | | This patch removes the ResolveExecutableLocation method from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53834 llvm-svn: 345853
* [FileSystem] Improve assert and add Terminate in unit test.Jonas Devlieghere2018-11-012-3/+6
| | | | | | | | Speculative fix for the Xcode bots where we were seeing the assertion being triggered because we would re-initialize the FileSystem without terminating it. llvm-svn: 345849
* [NativePDB] Get LLDB types from PDB function types.Zachary Turner2018-11-019-8/+561
| | | | | | | | | | | | | | This adds basic support for getting function signature types into LLDB's type system, including into clang's AST. There are a few edge cases which are not correctly handled, mostly dealing with nested classes, but this isn't specific to functions and apply equally to variable types. Note that no attempt has been made yet to deal with member function types, which will happen in subsequent patches. Differential Revision: https://reviews.llvm.org/D53951 llvm-svn: 345848
* [FileSystem] Remove GetPermissions() and Readable() from FileSpecJonas Devlieghere2018-11-0113-50/+17
| | | | | | | | | This patch removes the GetPermissions and GetReadable methods from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53831 llvm-svn: 345843
* [Windows] A basic implementation of memory allocations in a debuggee processAleksandr Urakov2018-11-014-1/+82
| | | | | | | | | | | | | | | | | | | Summary: This patch adds a basic implementation of `DoAllocateMemory` and `DoDeallocateMemory` for Windows processes. For now it considers only the executable permission (and always allows reads and writes). Reviewers: zturner, asmith, stella.stamenova, labath, clayborg Reviewed By: zturner Subscribers: Hui, vsk, jingham, aleksandr.urakov, clayborg, abidh, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D52618 llvm-svn: 345815
* [FileSystem] Remove GetByteSize() from FileSpecJonas Devlieghere2018-11-0113-28/+33
| | | | | | | | | This patch removes the GetByteSize method from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53788 llvm-svn: 345812
* [FileSystem] Move EnumerateDirectory from FileSpec to FileSystem.Jonas Devlieghere2018-11-0114-181/+142
| | | | | | | | | | | | | | This patch moves the EnumerateDirectory functionality and related enum and typedef from FileSpec to FileSystem. This is part of a set of patches that extracts file system related convenience methods from FileSpec. The long term goal is to remove this method altogether and use the iterators directly, but for introducing the VFS into LLDB this change is sufficient. Differential revision: https://reviews.llvm.org/D53785 llvm-svn: 345800
* [FileSystem] Re-add EnumerateDirectoryJonas Devlieghere2018-11-013-0/+76
| | | | | | Re-enable EnumerateDirectory now that no_push is available in llvm (r345793). llvm-svn: 345799
* [FileSystem] Remove EnumerateDirectoryJonas Devlieghere2018-10-313-76/+0
| | | | | | | | The new implementation of EnumerateDirectory relies on `::no_push()` being implemented for the VFS recursive directory iterators. However this patch (D53465) hasn't been landed yet. llvm-svn: 345787
* [FileSystem] Extend file system and have it use the VFS.Jonas Devlieghere2018-10-3132-68/+632
| | | | | | | | | | | | | | | | This patch extends the FileSystem class with a bunch of functions that are currently implemented as methods of the FileSpec class. These methods will be removed in future commits and replaced by calls to the file system. The new functions are operated in terms of the virtual file system which was recently moved from clang into LLVM so it could be reused in lldb. Because the VFS is stateful, we turned the FileSystem class into a singleton. Differential revision: https://reviews.llvm.org/D53532 llvm-svn: 345783
* Makefile.rules: Don't use code signing on macOS; it isn't necessary.Adrian Prantl2018-10-311-2/+3
| | | | llvm-svn: 345768
* [NFC] Fixed -Wsign-compare warningDavid Bolvansky2018-10-311-1/+1
| | | | llvm-svn: 345755
* [LLDB] - Regroup the switch entries in DWARFFormValue::ExtractValue. NFC.George Rimar2018-10-311-60/+26
| | | | | | | | This is NFC to clean up the `DWARFFormValue::ExtractValue`. It groups similar `DW_FORM_*` and removes an excessive assignment of `ref_addr_size` (it was assigned right after in any case). llvm-svn: 345733
* [LLDB] - Removed unused variable. NFC.George Rimar2018-10-311-4/+1
| | | | | | | | Introduced in r344119. Thanks to Dávid Bolvanský fo reporting. llvm-svn: 345720
* [lldb] Fix race condition in framework installationShoaib Meenai2018-10-311-1/+1
| | | | | | | | | | | | | We need the install-liblldb-stripped target to depend on the lldb-framework target in order for the installation to be guaranteed to behave correctly, otherwise it's possible for the lldb-framework and install-liblldb-stripped targets to run in parallel, resulting in temporary or partially processed files being copied into the framework. install-liblldb already depends on lldb-framework for this reason. Differential Revision: https://reviews.llvm.org/D53917 llvm-svn: 345711
* [LLDB] - Add support for DW_FORM_addrx[1-4]? forms.George Rimar2018-10-316-8/+124
| | | | | | | | | This adds the support for DW_FORM_addrx, DW_FORM_addrx1, DW_FORM_addrx2, DW_FORM_addrx3, DW_FORM_addrx4 forms. Differential revision: https://reviews.llvm.org/D53813 llvm-svn: 345706
* Fixup the Python-less build of ScriptedRecognizedStackFrameKuba Mracek2018-10-312-0/+6
| | | | llvm-svn: 345694
* [lldb] Introduce StackFrameRecognizer [take 3]Kuba Mracek2018-10-3124-16/+1163
| | | | | | | | This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector). Differential Revision: https://reviews.llvm.org/D44603 llvm-svn: 345693
* Revert r345686 due to build failuresKuba Mracek2018-10-3124-1162/+16
| | | | llvm-svn: 345688
* [lldb] Introduce StackFrameRecognizer [take 2]Kuba Mracek2018-10-3124-16/+1162
| | | | | | | | This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector). Differential Revision: https://reviews.llvm.org/D44603 llvm-svn: 345686
* Revert r345678 (build failure on Linux machines).Kuba Mracek2018-10-3124-1162/+16
| | | | llvm-svn: 345680
* [lldb] Introduce StackFrameRecognizerKuba Mracek2018-10-3124-16/+1162
| | | | | | | | This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector). Differential Revision: https://reviews.llvm.org/D44603 llvm-svn: 345678
* [testsuite] Skip an already failing test on MacOS.Davide Italiano2018-10-301-0/+1
| | | | | | | | Due to some libcxx changes to inlining, this now also crashes, so it gets reported as "failure" by the bot. This commit doesn't really change the status quo, just placates the bots. llvm-svn: 345668
* NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)Erik Pilkington2018-10-303-8/+7
| | | | | | | | | | We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC. Differential revision: https://reviews.llvm.org/D53547 llvm-svn: 345637
* [NativePDB] Add support for dumping global variables of class type.Zachary Turner2018-10-306-3/+345
| | | | | | | | | | | | | | | | | | | | | | | | | Previous patches added support for dumping global variables of primitive types, so we now do the same for class types. For the most part, everything just worked, there was only one minor bug needing fixed, which was that for variables of modified types (e.g. const, volatile, etc) we can't resolve the forward decl in CreateAndCacheType because the PdbSymUid must point to the LF_MODIFIER which must point to the forward decl. So when it comes time to call CompleteType, an assert was firing because we expected to get a class, struct, union, or enum, but we were getting an LF_MODIFIER instead. The other issue is that one the newly added tests is for an array member, which was not yet supported, so we add support for that now in this patch. There's probably room for other interesting layout test cases here, but this at least should test the basics. Differential Revision: https://reviews.llvm.org/D53822 llvm-svn: 345629
* [x86] Fix issues with a realigned stack in MSVC compiled applicationsAleksandr Urakov2018-10-308-150/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes issues with a stack realignment. MSVC maintains two frame pointers (`ebx` and `ebp`) for a realigned stack - one is used for access to function parameters, while another is used for access to locals. To support this the patch: - adds an alternative frame pointer (`ebx`); - considers stack realignment instructions (e.g. `and esp, -32`); - along with CFA (Canonical Frame Address) which point to the position next to the saved return address (or to the first parameter on the stack) introduces AFA (Aligned Frame Address) which points to the position of the stack pointer right after realignment. AFA is used for access to registers saved after the realignment (see the test); Here is an example of the code with the realignment: ``` struct __declspec(align(256)) OverAligned { char c; }; void foo(int foo_arg) { OverAligned oa_foo = { 1 }; auto aaa_foo = 1234; } void bar(int bar_arg) { OverAligned oa_bar = { 2 }; auto aaa_bar = 5678; foo(1111); } int main() { bar(2222); return 0; } ``` and here is the `bar` disassembly: ``` push ebx mov ebx, esp sub esp, 8 and esp, -100h add esp, 4 push ebp mov ebp, [ebx+4] mov [esp+4], ebp mov ebp, esp sub esp, 200h mov byte ptr [ebp-200h], 2 mov dword ptr [ebp-4], 5678 push 1111 ; foo_arg call j_?foo@@YAXH@Z ; foo(int) add esp, 4 mov esp, ebp pop ebp mov esp, ebx pop ebx retn ``` Reviewers: labath, zturner, jasonmolenda, stella.stamenova Reviewed By: jasonmolenda Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D53435 llvm-svn: 345577
* Utility: fix cross-compilation from Linux to WindowsSaleem Abdulrasool2018-10-301-1/+3
| | | | | | | | Only attempt to link against Backtrace if it is found. Without this, trying to cross-compile to Windows would try to link against "Backtrace_LIBRARY-NOTFOUND.lib". llvm-svn: 345569
* [lldb-mi] Implement -gdb-set breakpoint pending on/offMarc-Andre Laperle2018-10-309-3/+163
| | | | | | | | | | | | | | | | | | Summary: This allows creating pending breakpoint automatically when a location is not found. This is used by some front-ends instead of doing "-break-insert -f" every time. See also https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com> Subscribers: MaskRay, llvm-commits, lldb-commits, ki.stfu Tags: #lldb Differential Revision: https://reviews.llvm.org/D52953 llvm-svn: 345563
* [LLDB] - Fix outdated comment. NFC.George Rimar2018-10-291-2/+1
| | | | llvm-svn: 345498
* Fix and rename broken test for `settings write`.Jonas Devlieghere2018-10-261-10/+10
| | | | | | | | I committed this test without updating the old `settings export` to settings write. Since the functionality was renamed I also renamed the test case. llvm-svn: 345435
* Remove an early-return from Driver::ParseArgs thatJason Molenda2018-10-261-4/+0
| | | | | | | | | | was added as a part of D52604 / r343348. If the lldb driver is run without any arguments, .lldbinit file reading was not enabled. <rdar://problem/45570242> llvm-svn: 345422
* [DataFormatters] Adding formatters for libc++ std::u16string and std::u32stringShafik Yaghmour2018-10-266-12/+71
| | | | | | | | rdar://problem/41302849 Differential Revision: https://reviews.llvm.org/D53656 llvm-svn: 345402
* [Windows] Define generic arguments registers for Windows x64Aleksandr Urakov2018-10-261-6/+6
| | | | | | | | | | | | | | | | Summary: When evaluating expressions the generic arguments registers are required by ABI. This patch defines them. Reviewers: zturner, stella.stamenova, labath Subscribers: aleksandr.urakov, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D53753 llvm-svn: 345385
* [PDB] Fix `SymbolFilePDBTests` after r345313Aleksandr Urakov2018-10-261-2/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D53749 llvm-svn: 345374
* [NativePDB] Add the ability to dump dump global variables.Zachary Turner2018-10-265-17/+1087
| | | | | | | | | | | | | | | | | | | | | | | | | LLDB has the ability to display global variables, even without a running process, via the target variable command. This is because global variables are linker initialized, so their values are embedded directly into the executables. This gives us great power for testing native PDB functionality in a cross-platform manner, because we don't actually need a running process. We can just create a target using an EXE file, and display global variables. And global variables can have arbitrarily complex types, so in theory we can fully exercise the type system, record layout, and data formatters for native PDB files and PE/COFF executables on any host platform, as long as our type does not require a dynamic initializer. This patch adds basic support for finding variables by name, and adds an exhaustive test for fundamental data types and pointers / references to fundamental data types. Subsequent patches will extend this to typedefs, classes, pointers to functions, and other cases. Differential Revision: https://reviews.llvm.org/D53731 llvm-svn: 345373
* Update test that checks auto-completion for settings set.Jonas Devlieghere2018-10-261-0/+5
| | | | | | | This reverts r345350 and updates the test rather than removing it. Now we check that `--g` auto-completes to `--global`. llvm-svn: 345351
* Remove test that checks auto-completion for settings set.Jonas Devlieghere2018-10-261-5/+0
| | | | | | | With the new `-f` option for `settings set`, `-` (dash) no longer auto-complete to `-g`. llvm-svn: 345350
* Add functionality to export settingsJonas Devlieghere2018-10-269-21/+290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the reproducer feature I need to be able to export and import the current LLDB configuration. To realize this I've extended the existing functionality to print settings. With the help of a new formatting option, we can now write the settings and their values to a file structured as regular commands. Concretely the functionality works as follows: (lldb) settings export -f /path/to/file This file contains a bunch of settings set commands, followed by the setting's name and value. ... settings set use-external-editor false settings set use-color true settings set auto-one-line-summaries true settings set auto-indent true ... You can import the settings again by either sourcing the file or using the settings read command. (lldb) settings read -f /path/to/file Differential revision: https://reviews.llvm.org/D52651 llvm-svn: 345346
* Don't type-erase the FunctionNameType or TypeClass enums.Zachary Turner2018-10-2528-152/+186
| | | | | | | | | | This is similar to D53597, but following up with 2 more enums. After this, all flag enums should be strongly typed all the way through to the symbol files plugins. Differential Revision: https://reviews.llvm.org/D53616 llvm-svn: 345314
* Don't type-erase the SymbolContextItem enumeration.Zachary Turner2018-10-2537-117/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we get the `resolve_scope` parameter from the SB API, it's a `uint32_t`. We then pass it through all of LLDB this way, as a uint32. This is unfortunate, because it means the user of an API never actually knows what they're dealing with. We can call it something like `resolve_scope` and have comments saying "this is a value from the `SymbolContextItem` enumeration, but it makes more sense to just have it actually *be* the correct type in the actual C++ type system to begin with. This way the person reading the code just knows what it is. The reason to use integers instead of enumerations for flags is because when you do bitwise operations on enumerations they get promoted to integers, so it makes it tedious to constantly be casting them back to the enumeration types, so I've introduced a macro to make this happen magically. By writing LLDB_MARK_AS_BITMASK_ENUM after defining an enumeration, it will define overloaded operators so that the returned type will be the original enum. This should address all the mechanical issues surrounding using rich enum types directly. This way, we get a better debugger experience, and new users to the codebase can get more easily acquainted with the codebase because their IDE features can help them understand what the types mean. Differential Revision: https://reviews.llvm.org/D53597 llvm-svn: 345313
* [NFC] Refactor SetBaseClasses and DeleteBaseClasses.Zachary Turner2018-10-258-94/+87
| | | | | | | | | | | | | | | | | | | | | | We currently had a 2-step process where we had to call SetBaseClassesForType and DeleteBaseClasses. Every single caller followed this exact 2-step process, and there was manual memory management going on with raw pointers. We can do better than this by storing a vector of unique_ptrs and passing this around. This makes for a cleaner API, and we only need to call one method so there is no possibility of a user forgetting to call DeleteBaseClassSpecifiers. In addition to this, it also makes for a *simpler* API. Part of why I wanted to do this is because when I was implementing the native PDB interface I had to spend some time understanding exactly what I was deleting and why. ClangAST has significant mental overhead associated with it, and reducing the API surface can go along way to making it simpler for people to understand. Differential Revision: https://reviews.llvm.org/D53590 llvm-svn: 345312
* Remove accidentally committed duplicate codeAdrian Prantl2018-10-251-5/+0
| | | | llvm-svn: 345287
* Get rid of casts. (NFC)Adrian Prantl2018-10-252-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D53709 llvm-svn: 345278
* Fix a bug PlatformDarwin::SDKSupportsModule.Adrian Prantl2018-10-254-13/+41
| | | | | | | | | | | | | | | This fixes a bug PlatformDarwin::SDKSupportsModule introduced by https://reviews.llvm.org/D47889. VersionTuple::tryParse() can deal with an optional third (micro) component, but the parse will fail when there are extra characters after the version number (e.g.: trying to parse the substring "12.0.sdk" out of "iPhoneSimulator12.0.sdk" fails after that patch). Fixed here by stripping the ".sdk" suffix first. (Part of) rdar://problem/45041492 Differential Revision https://reviews.llvm.org/D53677 llvm-svn: 345274
* Recommit r345127 "[LLDB] - Add support for DW_RLE_base_address and ↵George Rimar2018-10-257-54/+188
| | | | | | | | | | | | | | | | | | | | | | | | DW_RLE_offset_pair entries (.debug_rnglists)" With the fix: do not forget to hanlde the DW_RLE_start_end, which seems was omited/forgotten/removed by mistake. Original commit message: The patch implements the support for DW_RLE_base_address and DW_RLE_offset_pair .debug_rnglists entries Differential revision: https://reviews.llvm.org/D53140 ---- Added : /lldb/trunk/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml Added : /lldb/trunk/lit/Breakpoint/debug_rnglist_offset_pair.test Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h llvm-svn: 345251
* [LLDB] - Parse the DW_LLE_startx_length correctly for DWARF v5 case.George Rimar2018-10-252-5/+11
| | | | | | | | | | | | | | | | | | | | | Currently, we always parse the length field of DW_LLE_startx_length entry as U32. That is correct for pre-standard definition: https://gcc.gnu.org/wiki/DebugFission - "A start/length entry contains one unsigned LEB128 number and a 4-byte unsigned value (as would be represented by the form code DW_FORM_const4u). The first number is an index into the .debug_addr section that selects the beginning offset, and the second number is the length of the range. ") But DWARF v5 says: "This is a form of bounded location description that has two unsigned ULEB operands. The first value is an address index (into the .debug_addr section) that indicates the beginning of the address range over which the location is valid. The second value is the length of the range." Fortunately, we can easily handle the difference. No test case because it seems impossible to test until we will be ready to use DWARF v5 in tests that need to run the executables. Differential revision: https://reviews.llvm.org/D53646 llvm-svn: 345249
* [API] Extend the `SBThreadPlan` interfaceAleksandr Urakov2018-10-257-0/+108
| | | | | | | | | | | | | | | | | | Summary: This patch extends the `SBThreadPlan` to allow retrieving of thread plans for scripted steps. Reviewers: labath, zturner, jingham Reviewed By: jingham Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D53361 llvm-svn: 345247
OpenPOWER on IntegriCloud