summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] find_first_of/find_last_of -> find/rfind for single char.Jonas Devlieghere2019-03-281-2/+2
| | | | | | | | | For a single char argument, find_first_of is equal to find and find_last_of is equal to rfind. While playing around with the plugin stuff this caused an export failure because it always got inlined except once, which resulted in an undefined symbol. llvm-svn: 357198
* [ObjectFileMachO] Remove another debugging aid.Davide Italiano2019-03-281-7/+0
| | | | | | Pointed out by Jason. llvm-svn: 357135
* [ObjectFileMachO] Disable memory caching for savecore.Davide Italiano2019-03-281-13/+6
| | | | | | | | | | | | | | | | | Summary: It's not really useful, and largely increases the footprint. <rdar://problem/49293525> Reviewers: jasonmolenda Subscribers: llvm-commits, lldb-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59896 llvm-svn: 357134
* [Python] Remove unused includesJonas Devlieghere2019-03-273-15/+7
| | | | llvm-svn: 357126
* Kill unused variable m_tu_decl_up in SymbolFilePDBNathan Lanza2019-03-272-10/+1
| | | | | | | | | | | | | | | | | | Summary: An TranslationUnitDecl was being brought in from the clang::ASTContext which required clang specific code to exist in SymbolFilePDB. Since it was unused we can just get rid of it along with the clang specific code. Reviewers: rnk, zturner, compnerd Reviewed By: compnerd Subscribers: jdoerfert Differential Revision: https://reviews.llvm.org/D59804 llvm-svn: 357113
* [Platform] Remove Kalimba PlatformJonas Devlieghere2019-03-275-311/+2
| | | | | | | | | This patch removes the Kalimba platform. For more information please refer to the corresponding thread on the mailing list. http://lists.llvm.org/pipermail/lldb-dev/2019-March/014921.html llvm-svn: 357086
* minidump: Add ability to attach (breakpad) symbol files to placeholder modulesPavel Labath2019-03-271-43/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This re-commits r354263, which was because it uncovered with handling of modules with empty (zero) UUIDs. This would cause us to treat two modules as intentical even though they were not. This caused an assert in PlaceholderObjectFile::SetLoadAddress to fire, because we were trying to load the module twice even though it was designed to be only loaded at a specific address. (The same problem also existed with the previous implementation, but it had no asserts to warn us about this.) These issues have now been fixed in r356896. windows bot. The issue there was that ObjectFilePECOFF vended its base address through the incorrect interface. SymbolFilePDB depended on that, which lead to assertion failures when SymbolFilePDB was attempting to use the placeholder object files as a base. This has been fixed in r354258 The original commit message was: The reason this wasn't working was that ProcessMinidump was creating odd object-file-less modules, and SymbolFileBreakpad required the module to have an associated object file because it needed to get its base address. This fixes that by introducing a PlaceholderObjectFile to serve as a dummy object file. The general idea for this is taken from D55142, but I've reworked it a bit to avoid the need for the PlaceholderModule class. Now that we have an object file, our modules are sufficiently similar to regular modules that we can use the regular Module class almost out of the box -- the only thing I needed to tweak was the Module::CreateModuleFromObjectFile functon to set the module's FileSpec in addition to it's architecture. This wasn't needed for ObjectFileJIT (the other user of CreateModuleFromObjectFile), but it shouldn't hurt it either, and the change seems like a straightforward extension of this function. Reviewers: clayborg, lemo, amccarth Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D57751 llvm-svn: 357060
* Fix a "memset clearing an object of non-trivial type" warning in DWARFFormValuePavel Labath2019-03-271-1/+1
| | | | | | | | This is diagnosed by gcc-8. The ValueType struct already has a default constructor which performs zero-initialization, so we can just call that instead of using memset. llvm-svn: 357056
* Fix an out-of-bounds error in RegisterContextDarwin_arm64Pavel Labath2019-03-271-2/+3
| | | | | | | | | | | | | | | | | Summary: gcc diagnoses this as "array subscript 63 is above array bounds of 'RegisterContextDarwin_arm64::VReg [32]'". The correct fix seems to be subtracting the fpu register base index, but I have no way of verifying that this actually works. Reviewers: jasonmolenda Subscribers: javed.absar, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D59495 llvm-svn: 357055
* Get the lang from the CompileUnit for ParseCompileUnitFunctionForPDBFuncNathan Lanza2019-03-271-1/+2
| | | | | | | | | | | | Summary: Instead of assuming that the language is C++ instead check the compunit for the language it received from the debug info. Subscribers: aprantl, jdoerfert Differential Revision: https://reviews.llvm.org/D59805 llvm-svn: 357044
* Frontend: Remove CompilerInstance::VirtualFileSystem, NFCDuncan P. N. Exon Smith2019-03-262-3/+2
| | | | | | | | | | | | | | | Remove CompilerInstance::VirtualFileSystem and CompilerInstance::setVirtualFileSystem, instead relying on the VFS in the FileManager. CompilerInstance and its clients already went to some trouble to make these match. Now they are guaranteed to match. As part of this, I added a VFS parameter (defaults to nullptr) to CompilerInstance::createFileManager, to avoid repeating construction logic in clients that just wanted to customize the VFS. https://reviews.llvm.org/D59377 llvm-svn: 357037
* [Python] Remove dynamic indirectionJonas Devlieghere2019-03-262-452/+69
| | | | | | | Now that the Python plugin relies on the SWIG symbols, we no longer need to dynamically resolve these functions. llvm-svn: 357034
* [ExpressionParser] Add swift-lldb case for finding clang resource dirAlex Langford2019-03-261-13/+32
| | | | | | | | | | | | | | Summary: I'm adding this to reduce the difference between swift-lldb and llvm.org's lldb. Reviewers: aprantl, davide, compnerd, JDevlieghere, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D59708 llvm-svn: 357030
* [ScriptInterpreterPython] Try to make the sanitizer bot green again.Davide Italiano2019-03-261-1/+1
| | | | | | Removing a use-after-free error. llvm-svn: 357006
* Minidump: Use minidump types defined in llvmPavel Labath2019-03-265-180/+82
| | | | | | | | This is the next step in moving the minidump parsing into llvm. I remove the minidump structures already defined in the llvm Object library and convert our parser to use those. NFC. llvm-svn: 356992
* [Python] Define empty SWIG wrapper for unit testin"Jonas Devlieghere2019-03-261-27/+0
| | | | | | | | | The python plugin uses wrappers generated by swig. For the symbols to be available, we'd need to link against liblldb, which is not an option because the symbols could conflict with the static library we are testing. Instead we define the symbols ourselves in the unit test. llvm-svn: 356971
* [Python] Move SWIG wrapper dependency into the pluginJonas Devlieghere2019-03-251-0/+27
| | | | | | This should fix the Windows bot (fingers crossed). llvm-svn: 356967
* [lldb] [Process/NetBSD] Use nullptr to fix template arg deductionMichal Gorny2019-03-251-1/+1
| | | | llvm-svn: 356960
* [ScriptInterpreterPython] Make SWIG callback private (NFC)Jonas Devlieghere2019-03-252-172/+208
| | | | | | | | With the initialization taking place inside the Python script interpreter, these function no longer need to be public. The exception is the g_swig_init_callback which is used from the RAII object. llvm-svn: 356944
* [ScriptInterpreterPython] Move SWIG initialization into the Python plugin (NFC)Jonas Devlieghere2019-03-252-38/+202
| | | | | | Abstract initialization of the Python SWIG support in the Python plugin. llvm-svn: 356942
* Minidump: Use minidump constants defined in llvmPavel Labath2019-03-256-193/+62
| | | | | | | | | | | | | | | This patch begins the process of migrating the "minidump" plugin to the minidump parser in llvm. The llvm parser is not fully finished yet, but even now, a lot of things can be switched over. The gradual migration process will allow us to easier detect if things break than doing a big one-step migration. Doing it early will allow us to make sure that the llvm parser fits the use case that we need in lldb. In this patch I start with the various minidump constants, which have their llvm equivalent. It doesn't contain any functional changes. The diff just reflects the different naming of things in llvm. llvm-svn: 356898
* Reapply minidump changes reverted in r356806Pavel Labath2019-03-252-24/+51
| | | | | | | | | The changes were reverted due to ubsan errors (unaligned accesses). Here I fix those errors by first copying the data into aligned storage. Besides fixing alignment issues, this also fixes reading of minidump strings on big-endian systems. llvm-svn: 356896
* [Reproducers] Fix GDB remote flakiness during replayJonas Devlieghere2019-03-221-24/+23
| | | | | | | | | | | | | | | | | | | | | | This fixes the flakiness of the GDB remote reproducer during replay. It was caused by a combination sending one ACK to many from the replay server and the code that "flushes" any queued GDB remote packets in GDBRemoteCommunicationClient::HandshakeWithServer. The spurious ACK was the result of combining both implicit and explicit handling of ACKs in the replay server. The handshake consists of an ACK followed by an QStartNoAckMode. As long as we haven't seen any QStartNoAckMode, we were sending implicit acknowledgments. So the first ACK got acknowledged twice, once implicitly, and once as part of the replay. The reason we didn't notice this was the code in HandshakeWithServer that "waits for any responses that might have been queued up in the remote GDB server and flush them all". A 10ms timeout is used to move on when no packets are left. If the second ACK didn't make it within those 10ms, all packets were offset by one. llvm-svn: 356825
* [ScriptInterpreter] Remove a warning and reformat comments.Davide Italiano2019-03-221-6/+6
| | | | llvm-svn: 356819
* [ScriptInterpreter] Make sure that PYTHONHOME is right.Davide Italiano2019-03-221-0/+10
| | | | | | | | | | | | | | | | | Summary: For the only version of Python actually supported on Darwin. <rdar://problem/40961425> Reviewers: jingham, friss, JDevlieghere, aprantl, jasonmolenda Subscribers: jdoerfert, llvm-commits, lldb-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59719 llvm-svn: 356816
* Revert minidump changesJonas Devlieghere2019-03-221-36/+13
| | | | | | | | | | | | | | This reverts the following two commits: Revert "Extend r356573 (minidump UUID handling) to cover elf build-ids too" Revert "Fix UUID decoding from minidump files" Greg's original commit broke the sanitizer bot which has been red for several days now. http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/ llvm-svn: 356806
* Revert "Move the rest of the sections over to DWARFContext."Pavel Labath2019-03-2217-327/+270
| | | | | | | | | | This reverts commit r356682 because it breaks the DWO flavours of some tests: lldb-Suite :: lang/c/const_variables/TestConstVariables.py lldb-Suite :: lang/c/local_variables/TestLocalVariables.py lldb-Suite :: lang/c/vla/TestVLA.py llvm-svn: 356773
* Extend r356573 (minidump UUID handling) to cover elf build-ids tooPavel Labath2019-03-221-1/+1
| | | | | | | | Breakpad (but not crashpad) will insert an empty (all-zero) build-id record for modules which do not have a build-id. This tells lldb to treat such records as empty/invalid uuids. llvm-svn: 356751
* [Reproducers] Fix log statementsJonas Devlieghere2019-03-211-3/+3
| | | | | | This isn't python where you can omit the index inside `{}`. llvm-svn: 356725
* [lldb] Add missing EINTR handlingMichal Gorny2019-03-214-7/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D59606 llvm-svn: 356703
* Move the rest of the sections over to DWARFContext.Zachary Turner2019-03-2117-270/+327
| | | | | | | | | This is mostly mechanical, and just moves the remaining non-DWO related sections over to DWARFContext. Differential Revision: https://reviews.llvm.org/D59611 llvm-svn: 356682
* [Reproducers] Properly handle QEnvironment packetsJonas Devlieghere2019-03-211-0/+15
| | | | | | | | On Linux, a QEnvironment packet is sent for every environment variable. This breaks replay when the number of environment variables is different then during capture. The solution is to always reply with OK. llvm-svn: 356643
* [Reproducers] Log inconsistencies during replay (NFC)Jonas Devlieghere2019-03-212-5/+41
| | | | | | | | Make debugging of the GDB remote packet aspect of reproducers easier by logging both requests and replies. This enables some sanity checking during replay. llvm-svn: 356638
* Introduce DWARFContext.Zachary Turner2019-03-208-54/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM's DWARF parsing library has a class called DWARFContext which holds all of the various DWARF data sections and lots of other information. LLDB's on the other hand stores all of this directly in SymbolFileDWARF / SymbolFileDWARFDwo and passes this interface around through the parsing library. Obviously this is incompatible with a world where the low level interface does not depend on the high level interface, so we need to move towards a model similar to LLVM's - i.e. all of the context needed for low level parsing should be in a single class, and that class gets passed around. This patch is a small incremental step towards achieving this. The interface and internals deviate from LLVM's for technical reasons, but the high level idea is the same. The goal is, eventually, to remove all occurrences of SymbolFileDWARF from the low level parsing code. For now I've chosen a very simple section - the .debug_aranges section to move into DWARFContext while leaving everything else unchanged. In the short term this is a bit confusing because now the information you need might come from either of 2 different locations. But it's a huge refactor to do this all at once and runs a much higher risk of breaking things. So I think it would be wise to do this in very small pieces. TL;DR - No functional change Differential Revision: https://reviews.llvm.org/D59562 llvm-svn: 356612
* Fix UUID decoding from minidump filesGreg Clayton2019-03-201-12/+35
| | | | | | | | | | | | | This patch fixes: UUIDs now don't include the age field from a PDB70 when the age is zero. Prior to this they would incorrectly contain the zero age which stopped us from being able to match up the UUID with real files. UUIDs for Apple targets get the first 32 bit value and next two 16 bit values swapped. Breakpad incorrectly swaps these values when it creates darwin minidump files, so this must be undone so we can match up symbol files with the minidump modules. UUIDs that are all zeroes are treated as invalid UUIDs. Breakpad will always save out a UUID, even if one wasn't available. This caused all files that have UUID values of zero to be uniqued to the first module that had a zero UUID. We now don't fill in the UUID if it is all zeroes. Added tests for PDB70 and ELF build ID based CvRecords. Differential Revision: https://reviews.llvm.org/D59433 llvm-svn: 356573
* Delete more dead code.Zachary Turner2019-03-1921-318/+11
| | | | | | | | All of this is code that is unreferenced. Removing as much of this as possible makes it more easy to determine what functionality is missing and/or shared between LLVM and LLDB's DWARF interfaces. llvm-svn: 356509
* Remove some dead DWARF enum -> string conversion functions.Zachary Turner2019-03-192-258/+0
| | | | llvm-svn: 356495
* Delete dead code.Zachary Turner2019-03-1923-716/+1
| | | | | | | | | | Most of these are Dump functions that are never called, but there is one instance of entire unused classes (DWARFDebugMacinfo and DWARFDebugMacinfoEntry) which are also unreferenced in the codebase). Differential Revision: https://reviews.llvm.org/D59276 llvm-svn: 356490
* [ScriptInterpreterPython] Remove dead code.Davide Italiano2019-03-191-16/+0
| | | | llvm-svn: 356487
* Remove a couple of log statements.Zachary Turner2019-03-193-60/+1
| | | | | | | | | | | | | These log statements have questionable value, and hinder the effort of separating the high and low level DWARF parsing interfaces inside of LLDB. Removing them for now, and if/when we need such log statements again in the future, we can add them back (if possible) or introduce a mechanism for logging from the low-level interface in such a way that it isn't coupled to the high level interface. Differential Revision: https://reviews.llvm.org/D59498 llvm-svn: 356469
* Improve error handling for Clang module imports.Adrian Prantl2019-03-191-3/+11
| | | | | | | | rdar://problem/48883558 Differential Revision: https://reviews.llvm.org/D59524 llvm-svn: 356462
* Fix "type qualifiers ignored on cast result type" warningsPavel Labath2019-03-182-13/+10
| | | | | | These warnings start to get emitted with gcc-8. llvm-svn: 356362
* Abbreviation declarations are required to have non-null tags.Zachary Turner2019-03-151-5/+3
| | | | | | Treat a null tag as an error. llvm-svn: 356284
* Return Error and Expected from more DWARF interfaces.Zachary Turner2019-03-159-209/+253
| | | | | | | | | | This continues the work of introducing Error and Expected into the DWARF parsing interfaces, this time for the DWARFCompileUnit and DWARFDebugAranges classes. Differential Revision: https://reviews.llvm.org/D59381 llvm-svn: 356278
* Delete type_sp member from TypePairPavel Labath2019-03-151-4/+3
| | | | | | | | | | | | | | | | | | | | Summary: As discussed in the review of D59217, this member is unnecessary since always the first thing we do is convert it to a CompilerType. This opens up possibilities for further cleanups (e.g. the whole TypePair class now loses purpose, since we can just pass around CompilerType everywhere), but I did not want to do that yet, because I am not sure if this will not introduce breakages in some of the platforms/configurations that I am not testing on. Reviewers: clayborg, zturner, jingham Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D59297 llvm-svn: 356262
* [ObjCLanguage] Remove LLDB_DISABLE_PYTHON markers from the formatters.Davide Italiano2019-03-141-6/+0
| | | | llvm-svn: 356210
* Return llvm::Error and llvm::Expected from DWARF parsing code.Zachary Turner2019-03-146-54/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal here is to improve our error handling and error recovery while parsing DWARF, while at the same time getting us closer to being able to merge LLDB's DWARF parser with LLVM's. To this end, I've udpated several of the low-level parsing functions in LLDB to return llvm::Error and llvm::Expected. For now, this only updates LLDB parsing functions and not LLVM. In some ways, this actually gets us *farther* from parity with the two interfaces, because prior to this patch, at least the parsing interfaces were the same (i.e. they all just returned bools, and now with this patch they're diverging). But, I chose to do this for two primary reasons. LLDB has error logging code engrained deep within some of its parsing functions. We don't want to lose this logging information, but obviously LLVM has no logging mechanism at all. So if we're to merge the interfaces, we have to find a way to still allow LLDB to properly report parsing errors while not having the reporting code be inside of LLVM. LLDB (and indeed, LLVM) overload the meaning of the false return value from all of these extraction functions to mean both "We reached the null entry at the end of a list of items, therefore everything was successful" as well as "something bad and unrecoverable happened during parsing". So you would have a lot code that would do something like: while (foo.extract(...)) { ... } But when the loop stops, why did it stop? Did it stop because it finished parsing, or because there was an error? Because of this, in some cases we don't always know whether it is ok to proceed, or how to proceed, but we were doing it anyway. In this patch, I solve the second problem by introducing an enumeration called DWARFEnumState which has two values MoreItems and Complete. Both of these indicate success, but the latter indicates that we reached the null entry. Then, I return this value instead of bool, and convey parsing failure separately. To solve the first problem (and convey parsing failure) these functions now return either llvm::Error or llvm::Expected<DWARFEnumState>. Having this extra bit of information allows us to properly convey all 3 of "error, bail out", "success, call this function again", and "success, don't call this function again". In subsequent patches I plan to extend this pattern to the rest of the parsing interfaces, which will ultimately get all of the log statements and error reporting out of the low level parsing code and into the high level parsing code (e.g. SymbolFileDWARF, DWARFASTParserClang, etc). Eventually, these same changes will have to be backported to LLVM's DWARF parser, but diverging in the short term is the easiest way to converge in the long term. Differential Revision: https://reviews.llvm.org/D59370 llvm-svn: 356190
* Safer casting in ClangExpressionParser code completionRaphael Isemann2019-03-141-2/+2
| | | | | | | | | | | | | | | | | | Summary: Makes the code a bit safer in the unlikely situation that we don't get a ClangUserExpression when doing code completion. Reviewers: aprantl, jingham Reviewed By: aprantl Subscribers: labath, jdoerfert, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D59359 llvm-svn: 356174
* [Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards.Davide Italiano2019-03-141-7/+0
| | | | | | | While we don't have a bot, I'm testing by hand that this configuration compiles. We'll probably set up one once I'm done flensing. llvm-svn: 356171
* [Reproducers] Fix data race found by tsanJonas Devlieghere2019-03-141-0/+2
| | | | | | | | This fixes a data race uncovered by tsan during destruction of the GDBRemoteReplay server. The solution is to lock the thread state mutex when receiving packets. llvm-svn: 356168
OpenPOWER on IntegriCloud