summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding ↵Jan Kratochvil2018-04-068-569/+828
| | | | | | | | | | | | | | | | | DWARFTypeUnit" The reverted commit changed DWARFUnit from https://reviews.llvm.org/D40466 and https://reviews.llvm.org/D42892 that was prepared for DWARFPartialUnit and made from it a superclass for DWARFTypeUnit. DWARFUnit's intention was: DWARFUnit->DWARFSomeNameUnit->DWARFCompileUnit DWARFUnit->DWARFSomeNameUnit->DWARFTypeUnit DWARFUnit->DWARFPartialUnit Discussed at: https://reviews.llvm.org/D45170 This reverts commit r329305. llvm-svn: 329423
* Fix windows build after r329296Pavel Labath2018-04-052-0/+2
| | | | | | Add a couple of #include <csignal>s. llvm-svn: 329309
* Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding DWARFTypeUnitGreg Clayton2018-04-058-828/+569
| | | | | | | | Many things that were in DWARFCompileUnit actually need to be in DWARFUnit. This patch moves all DWARFUnit specific things over into DWARFUnit and fixes the layering. This is in preparation for adding DWARFTypeUnit for the .debug_types patch. Differential Revision: https://reviews.llvm.org/D45170 llvm-svn: 329305
* Support template template parametersFrederic Riss2018-04-021-2/+17
| | | | | | | | | | | | | | | | | | Summary: We would fail to resolve (and thus display the value of) any templated type which contained a template template argument even though we don't really use template arguments. This patch adds minimal support for template template arguments, but I doubt we need any more than that. Reviewers: clayborg, jingham Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D44613 llvm-svn: 328984
* Prevent double release of mach portsFrederic Riss2018-03-291-2/+0
| | | | | | | | | | | | | | | | Summary: When a MIG routine returns KERN_FAILURE, the demux function will release any OOL resources like ports. In this case, task_port and thread_port will be released twice, potentially resulting in use after free of the ports. I don't think we can test this in any useful way rdar://problem/37331387 Reviewers: jasonmolenda Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D45011 llvm-svn: 328761
* gdb-remote: Fix checksum verification for messages with escape charsPavel Labath2018-03-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We've had a mismatch in the checksum computation between the sender and receiver. The sender computed the payload checksum using the wire encoding of the packet, while the receiver did this after expanding un-escaping and expanding run-length-encoded sequences. This resulted in communication breakdown if packets using these feature were sent in the ack mode. Normally, this did not cause any issues since the only packet we send in the ack-mode is the QStartNoAckMode packet, but I ran into this when debugging the lldb-server tests which (for better or worse) don't use this mode. According to the gdb-remote documentation "The two-digit checksum is computed as the modulo 256 sum of all characters between the leading ‘$’ and the trailing ‘#’", it seems that our sender is doing the right thing here. Therefore, I fix the receiver the match the sender behavior and add a test. With this bug fixed, we can see that lldb-server is sending a stop-reply after receiving the "k" in the same way as debugserver does (but we weren't detecting this because at that point the connection was dead already). I fix that expectation as well. Reviewers: clayborg, jasonmolenda Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D44922 llvm-svn: 328693
* Use the DWARF linkage name when importing C++ methods.Davide Italiano2018-03-272-7/+8
| | | | | | | | | | | | | | | | | | | | When importing C++ methods into clang AST nodes from the DWARF symbol table, preserve the DW_AT_linkage_name and use it as the linker ("asm") name for the symbol. Concretely, this enables `expression` to call into names that use the GNU `abi_tag` extension, and enables lldb to call into code using std::string or std::list from recent versions of libstdc++. See https://bugs.llvm.org/show_bug.cgi?id=35310 . It also seems broadly more robust than relying on the DWARF->clang->codegen pipeline to roundtrip properly, but I'm not immediately aware of any other cases in which it makes a difference. Patch by Nelson Elhage! Differential Revision: https://reviews.llvm.org/D40283 llvm-svn: 328658
* Fix check for verbose logging.Adrian Prantl2018-03-261-3/+2
| | | | | | Thanks to Pavel for pointing this out! llvm-svn: 328557
* Add support for __attribute__(trivial_abi).Jim Ingham2018-03-231-2/+22
| | | | | | <rdar://problem/36035075>, <rdar://problem/36035039> llvm-svn: 328389
* Log ObjC Runtime messages only in verbose modeAdrian Prantl2018-03-231-2/+2
| | | | llvm-svn: 328365
* [SymbolFilePDB] Use section contributions as another way to determine the ↵Aaron Smith2018-03-221-16/+19
| | | | | | | | | compiland Some PDB Symbols don't have line information. Use the section contributions to determine their compiland. This is useful to determine the parent compiland for PDBSymbolTypeData, i.e. variables. llvm-svn: 328232
* [SymbolFilePDB] Ignore compiler generated functions when creating the LLDB ↵Aaron Smith2018-03-222-4/+7
| | | | | | type from a PDB llvm-svn: 328230
* [SymbolFilePDB] Run clang-format; NFCAaron Smith2018-03-224-120/+107
| | | | llvm-svn: 328176
* Fix crash exposed by r328025Pavel Labath2018-03-211-2/+3
| | | | | | | | | | | | | | | | The issue was that the ASTDumper was being passed a null pointer (because we did not create any declaration for the operator==). The crash was in logging code, so it only manifested it self if you ran the tests with logging enabled (like our bots do). Given that this is logging code and the rest of the debugger is fine with the declaration being null, I just make sure the logging code can handle it as well. Right now I just do the null check in ClangExpressionDeclMap, but if the ASTDumper class is meant to be a debugging/logging aid, then it might be a good idea move the check inside the class itself. llvm-svn: 328088
* [ExpressionParser] Re-implement r327356 in a less disruptive way.Davide Italiano2018-03-202-9/+12
| | | | | | | | | | | | Instead of applying the sledgehammer of refusing to insert any C++ symbol in the ASTContext, try to validate the decl if what we have is an operator. There was other code in lldb which was responsible for this, just not really exposed (or used) in this codepath. Also, add a better/more comprehensive test. <rdar://problem/35645893> llvm-svn: 328025
* Move StringExtractorGDBRemote.h to the include folderPavel Labath2018-03-2010-10/+10
| | | | | | | | While trying to use this header I noticed that it is not in the include folder. Move it to there and update all #includes to reference that file correctly. llvm-svn: 327996
* Re-land: [lldb] Use vFlash commands when writing to target's flash memory ↵Pavel Labath2018-03-206-9/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | regions The difference between this and the previous patch is that now we use ELF physical addresses only for loading objects into the target (and the rest of the module load address logic still uses virtual addresses). Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region. A bare metal target may have this kind of setup. - Update ObjectFileELF to set load addresses using physical addresses. A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address. - Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications - Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html Reviewers: clayborg, labath Reviewed By: labath Subscribers: llvm-commits, arichardson, emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D42145 Patch by Owen Shaw <llvm@owenpshaw.net>. llvm-svn: 327970
* [SymbolFilePDB] Simplify code with newer methodsAaron Smith2018-03-202-16/+4
| | | | llvm-svn: 327927
* [SymbolFilePDB] Simplify getting the source file pathAaron Smith2018-03-202-66/+2
| | | | | | | | | | | | Summary: Replace SymbolFilePDB::GetSourceFileNameForPDBCompiland() with PDBSymbolCompiland::getSourceFileFullPath(). Reviewers: zturner, rnk, lldb-commits Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44456 llvm-svn: 327925
* [SymbolFilePDB] Remove a few null pointer checks by passing refAaron Smith2018-03-193-63/+46
| | | | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44455 llvm-svn: 327908
* Move the codebase to use: DWARFCompileUnit -> DWARFUnitJan Kratochvil2018-03-1825-204/+204
| | | | | | | | | | | | Now the codebase can use the DWARFUnit superclass. It will make it later seamlessly work also with DWARFPartialUnit for DWZ. This patch is only a search-and-replace easily undone, nothing interesting in it. Differential revision: https://reviews.llvm.org/D42892 llvm-svn: 327810
* DWARFUnit split out of DWARFCompileUnitJan Kratochvil2018-03-185-561/+796
| | | | | | | | | DW_TAG_partial_unit for DWZ can be then presented by DWARFPartialUnit also inherited from DWARFUnit. Differential revision: https://reviews.llvm.org/D40466 llvm-svn: 327809
* Fix the Windows build after r327750Frederic Riss2018-03-161-1/+1
| | | | llvm-svn: 327753
* [DWARFASTParserClang] Complete external record types before using them as a ↵Frederic Riss2018-03-161-0/+37
| | | | | | | | | | | | | | | | | | decl context. Summary: When in a gmodules-like debugging scenario, you can have a parent decl context that gets imported from an external AST. When this happens, we must be careful to complete this type before adding children to it, otherwise it sometimes results in a crash. Reviewers: clayborg, jingham Subscribers: aprantl, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43592 llvm-svn: 327750
* [DataFormatters] Implement summary for __NSDictionary0.Davide Italiano2018-03-141-0/+4
| | | | | | | | | | | | | | | | | | | Before the patch: (lldb) frame var emptyDictionary (__NSDictionary0 *) emptyDictionary = 0x0000000100304420 After: (lldb) frame var emptyDictionary (__NSDictionary0 *) emptyDictionary = 0x0000000100304420 0 key/value pairs There's nothing much else we can do, as this is always empty by definition. <rdar://problem/34806516> llvm-svn: 327587
* Use GetItemAtIndexAsString overload for ConstString and move set rather than ↵Tatyana Krasnukha2018-03-141-6/+3
| | | | | | copy. llvm-svn: 327549
* [SymbolFilePDB] Rewrite ParseTypes methodAaron Smith2018-03-141-19/+48
| | | | | | | | | | | | | | | | | | | | | Summary: The types for the compiland's children are parsed when parsing types for a PDB compiland. Global types also need to be parsed but unfortunately PDBs do not have compiland information about each global type. So we parse them all on the first call to ParseTypes. If a sc.function is provided then parse the types for that function. Otherwise parse the types for the overall sc.comp_unit. The ParseTypes method can be very slow if a program has a long list of compile units containing needed modules. Debugging clang-cl with lldb will show the problem. Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44253 llvm-svn: 327473
* [DataFormatter] Remove dead code for the NSDictionary formatter.Davide Italiano2018-03-131-10/+0
| | | | | | | I'm going to make changes in this area soon, so I figured I could clean things a bit while I was around. llvm-svn: 327445
* Fix clang-3.8 buildPavel Labath2018-03-131-1/+1
| | | | | | | | clang-3.8 complains that constructor for '...' must explicitly initialize the const member. Newer clangs and gcc seem to be fine with this, but explicitly initializing the member does not hurt. llvm-svn: 327380
* Fix linux s390x build (pr36694)Pavel Labath2018-03-131-1/+1
| | | | llvm-svn: 327379
* [ExpressionParser] Fix crash when evaluating invalid expresssions.Davide Italiano2018-03-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Typical example, illformed comparisons (operator== where LHS and RHS are not compatible). If a symbol matched `operator==` in any of the object files lldb inserted a generic function declaration in the ASTContext on which Sema operates. Maintaining the AST context invariants is fairly tricky and sometimes resulted in crashes inside clang (or assertions hit). The real reason why this feature exists in the first place is that of allowing users to do something like: (lldb) call printf("patatino") even if the debug informations for printf() is not available. Eventually, we might reconsider this feature in its entirety, but for now we can't remove it as it would break a bunch of users. Instead, try to limit it to non-C++ symbols, where getting the invariants right is hopefully easier. Now you can't do in lldb anymore (lldb) call _Zsomethingsomething(1,2,3) but that doesn't seem to be such a big loss. <rdar://problem/35645893> llvm-svn: 327356
* Re-add change for https://reviews.llvm.org/D42582 with added directories.Jim Ingham2018-03-124-0/+125
| | | | llvm-svn: 327331
* Revert "Improve prologue handling to support functions with multiple entry ↵Vedant Kumar2018-03-121-1/+0
| | | | | | | | | | | | | | | points." This reverts commit r327318. It breaks the Xcode and CMake Darwin builders: clang: error: no such file or directory: '.../source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp' clang: error: no input files More details are in https://reviews.llvm.org/D42582. llvm-svn: 327327
* Improve prologue handling to support functions with multiple entry points.Jim Ingham2018-03-121-0/+1
| | | | | | | | https://reviews.llvm.org/D42582 Patch from Leandro Lupori. llvm-svn: 327318
* [SymbolFilePDB] Keep searching until the file name is found for the pdb ↵Aaron Smith2018-03-091-2/+3
| | | | | | | | | | | | | | compiland Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44182 llvm-svn: 327162
* [elf] Remove one copy of the section merging codePavel Labath2018-03-091-32/+4
| | | | | | | | | | | | | | | | Summary: Besides being superfluous, this double merging was actually wrong and causing some sections to be added twice. The reason for that was that the code assumes section IDs are unique in the section list, but this is only true if all sections in the list come from the same object file. Reviewers: fjricci, jankratochvil Subscribers: emaste, lldb-commits, arichardson Differential Revision: https://reviews.llvm.org/D44157 llvm-svn: 327123
* Move option parsing out of the Args classPavel Labath2018-03-091-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The args class is used in plenty of places (a lot of them in the lower lldb layers) for representing a list of arguments, and most of these places don't care about option parsing. Moving the option parsing out of the class removes the largest external dependency (there are a couple more, but these are in static functions), and brings us closer to being able to move it to the Utility module). The new home for these functions is the Options class, which was already used as an argument to the parse calls, so this just inverts the dependency between the two. The functions are themselves are mainly just copied -- the biggest functional change I've made to them is to avoid modifying the input Args argument (getopt likes to permute the argument vector), as it was weird to have another class reorder the entries in Args class. So now the functions don't modify the input arguments, and (for those where it makes sense) return a new Args vector instead. I've also made the addition of a "fake arg0" (required for getopt compatibility) an implementation detail rather than a part of interface. While doing that I noticed that ParseForCompletion function was recording the option indexes in the shuffled vector, but then the consumer was looking up the entries in the unshuffled one. This manifested itself as us not being able to complete "watchpoint set variable foo --" (because getopt would move "foo" to the end). Surprisingly all other completions (e.g. "watchpoint set variable foo --w") were not affected by this. However, I couldn't find a comprehensive test for command argument completion, so I consolidated the existing tests and added a bunch of new ones. Reviewers: davide, jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43837 llvm-svn: 327110
* Fix std unique pointer pretty-printer for new stl versionsPavel Labath2018-03-081-4/+23
| | | | | | | | | | | | | | | Summary: The unique pointer layout was changed in libstdc++ 6.0.23. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: luporl, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D44015 Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>. llvm-svn: 327017
* [SymbolFilePDB] Add missing Char16 and Char32 types in a few placesAaron Smith2018-03-071-0/+10
| | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Subscribers: clayborg, llvm-commits Differential Revision: https://reviews.llvm.org/D44166 llvm-svn: 326875
* [SymbolFilePDB] Minor cleanupAaron Smith2018-03-071-22/+23
| | | | | | | | | | | | | | | | | | | Summary: - Remove unused code - Adding `break` statement conditionally - Ignore empty strings in FindTypeByName Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44165 llvm-svn: 326870
* [SymbolFilePDB] Add support for CVR pointer type qualifierAaron Smith2018-03-071-20/+44
| | | | | | | | | | | | | | | | | Summary: - Complete element type of PDBSymbolTypeArray. - Add a test to check types of multi-dimensional array and pointers with CVR. Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44167 llvm-svn: 326859
* [SymbolFilePDB] Get line number for PDBSymbolTypeEnumAaron Smith2018-03-071-8/+12
| | | | | | | | | | | | Reviewers: zturner, lldb-commits, rnk Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44164 llvm-svn: 326858
* ObjectFileMachO: split CreateSections mega-function into more manageable chunksPavel Labath2018-03-062-508/+517
| | | | | | | | | | | | | | | | | | | | | | | | Summary: In an effort to understand the function's operation, I've split it into logical pieces. Parsing of a single segment is moved to a separate function (and the parsing state that is carried from one segment to another is explicitly captured in the SegmentParsingContext object). I've also extracted some pieces of code which were already standalone (validation of the segment load command, determining the section type, determining segment permissions) into separate functions. Parsing of a single section within the segment should probably also be a separate function, but I've left that for a separate patch. This patch is intended to be NFC. Reviewers: clayborg, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D44074 llvm-svn: 326791
* [LLDB][PPC64] Fixed issues with expedited registersPavel Labath2018-03-061-0/+4
| | | | | | | | | | | | | | | | | Summary: - reg_nums were missing the end marker entry - marked FP test to be skipped for ppc64 Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: alexandreyy, lbianc, nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D43767 Patch by Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 326775
* ObjectFileMachO: use early return to remove one nesting level from ↵Pavel Labath2018-03-031-532/+513
| | | | | | | | CreateSections() NFCI llvm-svn: 326667
* Make the clang module cache setting available without a targetAdrian Prantl2018-03-021-6/+5
| | | | | | | | | | | | | | | It turns out that setting the clang module cache after LLDB has a Target can be too late. In particular, the Swift language plugin needs to know the setting without having access to a Target. This patch moves the setting into the *LLDB* module cache, where it is a global setting that is available before any Target is created and more importantly, is shared between all Targets. rdar://problem/37944432 Differential Revision: https://reviews.llvm.org/D43984 llvm-svn: 326628
* Make Finalize tolerant of empty register sets.Tatyana Krasnukha2018-03-011-1/+1
| | | | llvm-svn: 326437
* We were getting the wrong dynamic type if there were two classes with the ↵Jim Ingham2018-03-011-2/+7
| | | | | | | | | | | | | | same basename. There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with :: and pass eTypeClassAny for the type. In this case we always know that the name we get from the vtable name is absolute so we can work around the bug by prepending the "::". This doesn't fix the FindTypes bug. <rdar://problem/38010986> llvm-svn: 326412
* Revert "[lldb] Use vFlash commands when writing to target's flash memory ↵Pavel Labath2018-02-286-379/+10
| | | | | | | | | | | | regions" This reverts commit r326261 as it introduces inconsistencies in the handling of load addresses for ObjectFileELF -- some parts of the class use physical addresses, and some use virtual. This has manifested itself as us not being able to set the load address of the vdso "module" on android. llvm-svn: 326367
* [lldb] Use vFlash commands when writing to target's flash memory regionsPavel Labath2018-02-276-10/+379
| | | | | | | | | | | | | | | | | | | | | | Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region. A bare metal target may have this kind of setup. - Update ObjectFileELF to set load addresses using physical addresses. A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address. - Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications - Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html Reviewers: clayborg, labath Reviewed By: labath Subscribers: arichardson, emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D42145 Patch by Owen Shaw <llvm@owenpshaw.net> llvm-svn: 326261
OpenPOWER on IntegriCloud