summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace "nullptr-terminated" C-arrays of OptionValueEnumeration with safer ↵Tatyana Krasnukha2018-09-268-54/+52
| | | | | | | | llvm::ArrayRef Differential Revision: https://reviews.llvm.org/D49017 llvm-svn: 343130
* [PDB] Restore the calling convention from PDBAleksandr Urakov2018-09-261-1/+22
| | | | | | | | | | | | | | | | | | | Summary: This patch implements restoring of the calling convention from PDB. It is necessary for expressions evaluation, if we want to call a function of the debuggee process with a calling convention other than ccall. Reviewers: clayborg, zturner, labath, asmith Reviewed By: clayborg Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52501 llvm-svn: 343084
* Change the unwinder to not use a hard-coded limit on theJason Molenda2018-09-251-1/+3
| | | | | | | | | | max number of stack frames to backtrace, make it a setting, target.process.thread.max-backtrace-depth. Add a test case for the setting. <rdar://problem/28759559> llvm-svn: 343029
* Replace boolean parameter with enum value according r342633Tatyana Krasnukha2018-09-251-2/+2
| | | | llvm-svn: 342998
* Change type of m_user_expression_start_pos to size_tRaphael Isemann2018-09-222-2/+2
| | | | | | | | | AbsPosToLineColumnPos is the only reader of m_user_expression_start_pos and actually treats it like a size_t. Also the value we store in m_user_expression_start_pos is originally a size_t, so it makes sense to change the type of this variable to size_t. llvm-svn: 342804
* Move architecture-specific address adjustment to architecture pluginsTatyana Krasnukha2018-09-216-0/+339
| | | | | | Differential Revision: https://reviews.llvm.org/D48623 llvm-svn: 342762
* Replace boolean parameter with enum value according r342633Tatyana Krasnukha2018-09-201-1/+1
| | | | llvm-svn: 342671
* [NFC] Turn "load dependent files" boolean into an enumJonas Devlieghere2018-09-2014-26/+23
| | | | | | | | | | | | | | This is an NFC commit to refactor the "load dependent files" parameter from a boolean to an enum value. We want to be able to specify a default, in which case we decide whether or not to load the dependent files based on whether the target is an executable or not (i.e. a dylib). This is a dependency for D51934. Differential revision: https://reviews.llvm.org/D51859 llvm-svn: 342633
* [DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour2018-09-195-0/+302
| | | | | | | | | | rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520 llvm-svn: 342563
* Revert "[DataFormatters] Add formatter for C++17 std::variant"Shafik Yaghmour2018-09-175-319/+0
| | | | | | | | This reverts commit r342421. Because it breaks build bot http://green.lab.llvm.org/green/job/lldb-cmake-clang-5.0.2//418/console llvm-svn: 342424
* [DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour2018-09-175-0/+319
| | | | | | | | | | rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520 llvm-svn: 342421
* Add descriptions to completed expressionsRaphael Isemann2018-09-171-8/+32
| | | | | | | | | | | | | | | | | Summary: Completing inside the expression command now uses the new description API to also provide additional information to the user. For now this information are the types of variables/fields and the signatures of completed function calls. Reviewers: #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D52103 llvm-svn: 342385
* [PDB] Use the raw PDB symbol interface more accuratelyAleksandr Urakov2018-09-141-13/+39
| | | | | | | | | | | | | | | | | | Summary: This patch adds some symbol tag checks before using the `IPDBRawSymbol` interface to improve safety and readability. Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51967 llvm-svn: 342208
* Add a "scripted" breakpoint type to lldb.Jim Ingham2018-09-132-2/+112
| | | | | | | | | | This change allows you to write a new breakpoint type where the logic for setting breakpoints is determined by a Python callback written using the SB API's. Differential Revision: https://reviews.llvm.org/D51830 llvm-svn: 342185
* NativeProcessProtocol: Sink ReadMemoryWithoutTrap into base classPavel Labath2018-09-134-24/+0
| | | | | | | | The two existing implementations have the function implemented identically, and there's no reason to believe that this would be different for other implementations. llvm-svn: 342167
* [LLDB] - Improved DWARF5 support.George Rimar2018-09-1313-79/+295
| | | | | | | | | This patch improves the support of DWARF5. Particularly the reporting of source code locations. Differential revision: https://reviews.llvm.org/D51935 llvm-svn: 342153
* Fix two issues in PDBASTParserPavel Labath2018-09-121-17/+16
| | | | | | | - gcc warning about using binary or for or-ing two comparisons (a == b | a == c) - llvm style prefers static functions to functions in an anonymous namespace llvm-svn: 342051
* Move SafeMachO from Utility to HostPavel Labath2018-09-1211-12/+9
| | | | | | | | | | | | | | | | | | | | | | Summary: One of the conclusions of the discussion on D49740 was that SafeMachO is better off in the Host module (as that's the only place which should include mach/machine.h, which is what this header is working around). Also, Utility, which is the only module which cannot include Host, should not be doing anything with object file formats. This patch implements that move, and also removes any unneded includes of that file. I've verified that MacOS still compiles after this. Reviewers: jingham, zturner, teemperor Subscribers: fedor.sergeev, lldb-commits Differential Revision: https://reviews.llvm.org/D50383 llvm-svn: 342050
* Reduce alignment on struct XSAVE, fixing a gcc warningPavel Labath2018-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | The warning is about heap-allocating a struct with bigger alignment requirements than the standard heap allocator provides. AFAICT, all uses of the XSAVE struct are already heap-allocated, so this high alignment does not actually have any effect and removing it should be NFC. I have also done some digging in the commit history. This alignment requirement was since the XSAVE struct was introduced in r180572 when adding AVX register support for linux. It does not mention the alignment specifically, so I am guessing this was just put there because the corresponging XSAVE cpu instruction requires its buffer to be 64-byte aligned. However, LLDB will not be normally reading this struct via the XSAVE instruction directly. Instead we will ask the kernel to copy the buffer saved when suspeding the inferior. This should not require such strict alignment (in fact, linux kernel will happily do this for any alignment). llvm-svn: 342029
* [MIPS] Fix signed overflow in DADDIU emulationVedant Kumar2018-09-111-1/+12
| | | | | | | | This fixes a signed integer overflow diagnostic reported by ubsan. rdar://44353380 llvm-svn: 342008
* Refactoring std::function formatter to move core functionality into ↵Shafik Yaghmour2018-09-111-197/+26
| | | | | | | | | | CPPLanguageRuntime Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51896 llvm-svn: 341991
* [PDB] Fix problems after rL341782Aleksandr Urakov2018-09-111-1/+1
| | | | | | | | | | | | | Summary: This commit fixes following problems after rL341782: - Broken SymbolFilePDBTests - Warning on comparison of integers of different signs Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341942
* Print the correct error when our DynamicCheckerFunctions fail to installRaphael Isemann2018-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: The check is inverted here: If we have error messages, we should print those instead of our default error message. But currently we print the default message when we actually have a sensible error to print. Fixes https://bugs.llvm.org/show_bug.cgi?id=38383 Thanks Nat for the patch! Reviewers: #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D51602 llvm-svn: 341940
* Undoing first commit which added a space to a commentShafik Yaghmour2018-09-101-1/+1
| | | | llvm-svn: 341881
* First test commit into svn, adding space to commentShafik Yaghmour2018-09-101-1/+1
| | | | llvm-svn: 341879
* [PDB] Restore AST from PDB symbolsAleksandr Urakov2018-09-104-157/+640
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds an implementation of retrieving of declarations and declaration contexts based on PDB symbols. PDB has different type symbols for const-qualified types, and this implementation ensures that only one declaration was created for both const and non-const types, but creates different compiler types for them. The implementation also processes the case when there are two symbols corresponding to a variable. It's possible e.g. for class static variables, they has one global symbol and one symbol belonging to a class. PDB has no info about namespaces, so this implementation parses the full symbol name and tries to figure out if the symbol belongs to namespace or not, and then creates nested namespaces if necessary. Reviewers: asmith, zturner, labath Reviewed By: asmith Subscribers: aleksandr.urakov, teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341782
* Speculative fix for NetBSD bot for r341758Pavel Labath2018-09-091-2/+2
| | | | llvm-svn: 341759
* Re-commit "Modernize NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode"Pavel Labath2018-09-094-93/+13
| | | | | | | | | | | | | This recommits r341487, which was reverted due to failing tests with clang. It turned out I had incorrectly expected that the literal arrays passed to ArrayRef constructor will have static (permanent) storage. This was only the case with gcc, while clang was constructing them on stack, leading to dangling pointers when the function returns. The fix is to explicitly assign static storage duration to the opcode arrays. llvm-svn: 341758
* Revert "Modernize NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode"Pavel Labath2018-09-084-14/+95
| | | | | | | This reverts commit r341487. Jan Kratochvil reports it breaks LLDB when compiling with clang. llvm-svn: 341747
* NFC: Move Searcher::Depth into lldb-enumerations as SearchDepth.Jim Ingham2018-09-071-3/+3
| | | | | | | | In a subsequent commit, I will need to expose the search depth to the SB API's, so I'm moving this define into lldb-enumerations where it will get added to the lldb module. llvm-svn: 341690
* Enable the fp-armv8 disassembler feature when disassembling Cortex-MJason Molenda2018-09-071-2/+4
| | | | | | | | | | code. This will enable disassembly of the optional subset of neon that some Cortex cores support. Add a unit test to check that a few of these instructions disassemble as expected. <rdar://problem/26674303> llvm-svn: 341623
* Reland [ClangUserExpression][NFC] Removed unused codeRaphael Isemann2018-09-061-3/+1
| | | | | | | | The GetLanguageForExpr has side effects, so we can't remove this call without breaking the completion mechanism. However, we can keep the change that gets rid of this unnecessary variable. llvm-svn: 341535
* Revert "[ClangUserExpression][NFC] Removed unused code"Raphael Isemann2018-09-061-0/+4
| | | | | | | GetLanguageForExpr has side effects, so this actually breaks the completion. Should fix TestExprCompletion. llvm-svn: 341532
* Re-instate a bit of code that was commented out in r188246 whichJason Molenda2018-09-061-8/+16
| | | | | | | | | | | | | | | | | | | | | | | reads an ObjectFileMachO's string table in one chunk. Originally this was commented out because binaries in the system's shared cache all share a mega-string table and so reading the entire mega-strtab for each binary was a performance problem. In the reinstated code, I add a check that the binary we're reading from memory is not in the shared cache (there isn't a constant in <mach-o/loader.h> for this bit yet; we hardcode the value in one other place in ObjectFileMachO alread). For binaries that we're reading out of memory that are NOT in the shared cache, reading the string table in one chunk is a big performance improvement. Also have debugserver send up the flags value for binaries in its response to the jGetLoadedDynamicLibrariesInfos request. NFC. <rdar://problem/33604496> llvm-svn: 341511
* Modernize NativeProcessProtocol::GetSoftwareBreakpointTrapOpcodePavel Labath2018-09-054-95/+14
| | | | | | | | | | | | return the opcode as a Expected<ArrayRef> instead of a Status+pointer+size combo. I also move the linux implementation to the base class, as the trap opcodes are likely to be the same for all/most implementations of the class (except the arm one, where linux chooses a different opcode than what the arm spec recommends, which I keep linux-specific). llvm-svn: 341487
* [NFC] Fixed enum constant in boolean context errorDavid Bolvansky2018-09-031-5/+6
| | | | | | | | | | | | | | | | | | | Summary: /home/xbolva00/LLVM/llvm/tools/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:656:59: warning: enum constant in boolean context [-Wint-in-bool-context] if (mh.magic == llvm::MachO::MH_CIGAM || llvm::MachO::MH_MAGIC) ^~~~~~~~ /home/xbolva00/LLVM/llvm/tools/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:658:62: warning: enum constant in boolean context [-Wint-in-bool-context] if (mh.magic == llvm::MachO::MH_CIGAM_64 || llvm::MachO::MH_MAGIC_64) Reviewers: JDevlieghere, teemperor Reviewed By: teemperor Subscribers: abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D51600 llvm-svn: 341340
* [ClangUserExpression][NFC] Removed unused codeDavid Bolvansky2018-09-031-4/+0
| | | | llvm-svn: 341334
* Increase qHostInfo packet timeoutPavel Labath2018-08-311-0/+3
| | | | | | | | | Host info computation can involve DNS traffic (to compute the remote host name). On very unreliable networks (such as free WiFi on trains), this can take several seconds to complete or timeout. Increase the qHostInfo timeout to account for this. llvm-svn: 341164
* Use a CompletionRequest in the expression command completion [NFC]Raphael Isemann2018-08-304-10/+11
| | | | | | | | The patch was originally written before we had a CompletionRequest, so it still used a StringList to pass back the completions to the request. llvm-svn: 341124
* Move NoBuiltin=true closer to the other LangOpts code [NFC]Raphael Isemann2018-08-301-4/+4
| | | | llvm-svn: 341121
* Adjusting some comments in ClangExpressionParser.cppRaphael Isemann2018-08-301-2/+1
| | | | llvm-svn: 341112
* Added missing include to <cctype> for 'std::isalnum'Raphael Isemann2018-08-301-0/+1
| | | | | | Should fix the failing Windows bots. llvm-svn: 341109
* Fixed code style for the CodeCompletion members [NFC]Raphael Isemann2018-08-301-10/+10
| | | | | | | This code is in LLDB, so it should also follow the LLDB code style and use the m_ prefix for members. llvm-svn: 341105
* Move Predicate.h from Host to UtilityRaphael Isemann2018-08-304-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This class was initially in Host because its implementation used to be very OS-specific. However, with C++11, it has become a very simple std::condition_variable wrapper, with no host-specific code. It is also a general purpose utility class, so it makes sense for it to live in a place where it can be used by everyone. This has no effect on the layering right now, but it enables me to later move the Listener+Broadcaster+Event combo to a lower layer, which is important, as these are used in a lot of places (notably for launching a process in Host code). Reviewers: jingham, zturner, teemperor Reviewed By: zturner Subscribers: xiaobai, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D50384 llvm-svn: 341089
* Added initial code completion support for the `expr` commandRaphael Isemann2018-08-305-5/+439
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds initial code completion support for the `expr` command. We now have a completion handler in the expression CommandObject that essentially just attempts to parse the given user expression with Clang with an attached code completion consumer. We filter and prepare the code completions provided by Clang and send them back to the completion API. The current completion is limited to variables that are in the current scope. This includes local variables and all types used by local variables. We however don't do any completion of symbols that are not used in the local scope (or in some other way already in the ASTContext). This is partly because there is not yet any code that manually searches for additiona information in the debug information. Another cause is that for some reason the existing code for loading these additional symbols when requested by Clang doesn't seem to work. This will be fixed in a future patch. Reviewers: jingham, teemperor Reviewed By: teemperor Subscribers: labath, aprantl, JDevlieghere, friss, lldb-commits Differential Revision: https://reviews.llvm.org/D48465 llvm-svn: 341086
* Remove redundant initializationAdrian Prantl2018-08-301-1/+1
| | | | llvm-svn: 341080
* Move the column marking functionality to the Highlighter frameworkRaphael Isemann2018-08-302-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The syntax highlighting feature so far is mutually exclusive with the lldb feature that marks the current column in the line by underlining it via an ANSI color code. Meaning that if you enable one, the other is automatically disabled by LLDB. This was caused by the fact that both features inserted color codes into the the source code and were likely to interfere with each other (which would result in a broken source code printout to the user). This patch moves the cursor code into the highlighting framework, which provides the same feature to the user in normal non-C source code. For any source code that is highlighted by Clang, we now also have cursor marking for the whole token that is under the current source location. E.g., before we underlined only the '!' in the expression '1 != 2', but now the whole token '!=' is underlined. The same for function calls and so on. Below you can see two examples where we before only underlined the first character of the token, but now underline the whole token. {F7075400} {F7075414} It also simplifies the DisplaySourceLines method in the SourceManager as most of the code in there was essentially just for getting this column marker to work as a FormatEntity. Reviewers: aprantl Reviewed By: aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D51466 llvm-svn: 341003
* Don't cancel the current IOHandler when we push a handler for an utility ↵Raphael Isemann2018-08-297-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function run. Summary: D48465 is currently blocked by the fact that tab-completing the first expression is deadlocking LLDB. The reason for this deadlock is that when we push the ProcessIO handler for reading the Objective-C runtime information from the executable (which is triggered when we parse the an expression for the first time), the IOHandler can't be pushed as the Editline::Cancel method is deadlocking. The deadlock in Editline is coming from the m_output_mutex, which is locked before we go into tab completion. Even without this lock, calling Cancel on Editline will mean that Editline cleans up behind itself and deletes the current user-input, which is screws up the console when we are tab-completing at the same time. I think for now the most reasonable way of fixing this is to just not call Cancel on the current IOHandler when we push the IOHandler for running an internal utility function. As we can't really write unit tests for IOHandler itself (due to the hard dependency on an initialized Debugger including all its global state) and Editline completion is currently also not really testable in an automatic fashion, the test for this has to be that the expression command completion in D48465 doesn't fail when requesting completion the first time. A more precise test plan for this is: 1. Apply D48465. 2. Start lldb and break in some function. 3. Type `expr foo` and press tab to request completion. 4. Without this patch, we deadlock and LLDB stops responding. I'll provide an actual unit test for this once I got around and made the IOHandler code testable, but for now unblocking D48465 is more critical. Thanks to Jim for helping me debugging this. Reviewers: jingham Reviewed By: jingham Subscribers: emaste, clayborg, abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D50912 llvm-svn: 340988
* Don't include the Age in the UUID for CvRecordPdb70 UUID records in minidump ↵Greg Clayton2018-08-291-2/+12
| | | | | | | | | | | | | | | | | files for Apple vendors. The CvRecordPdb70 structure looks like: struct CvRecordPdb70 { uint8_t Uuid[16]; llvm::support::ulittle32_t Age; // char PDBFileName[]; }; We were including the "Age" in the UUID for Apple vedors which caused us to not be able to match the UUID to built binaries. The "Age" field is set to zero in breakpad minidump files for Apple targets. Differential Revision: https://reviews.llvm.org/D51442 llvm-svn: 340966
* [PDB] Resolve a symbol context block info correctlyAleksandr Urakov2018-08-291-3/+7
| | | | | | | | | | | | | | | | | | | Summary: This patch allows to resolve a symbol context block info even if a function info was not requested. Also it adds the correct resolving of nested blocks (the previous implementation used function blocks instead of them). Reviewers: zturner, asmith, labath Reviewed By: asmith Subscribers: lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51104 llvm-svn: 340901
OpenPOWER on IntegriCloud