aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SystemInitializerFull.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-01-21[lldb/Initializers] Move all ObjC initializers into AppleObjCRuntimeJonas Devlieghere1-6/+3
AppleObjCRuntime is the main entry point to the plugin with the same name. This is part of a greater refactoring to auto generate the initializers. NFC. Differential revision: https://reviews.llvm.org/D73121
2020-01-21[lldb/Plugin] Move DisassemblerLLVMC for consistency with plugin (NFC)Jonas Devlieghere1-1/+1
Rename the DisassemblerLLVMC directory from llvm to LLVMC to match the plugin name.
2020-01-21[lldb/Plugin] Rename MainThreadCheckerRuntime for consistency with plugin (NFC)Jonas Devlieghere1-3/+4
Renames MainThreadCheckerRuntime to InstrumentationRuntimeMainThreadChecker to be consistent with the directory structure and plugin name.
2020-01-21[lldb/Plugin] Rename UBSanRuntime for consistency with plugin (NFC)Jonas Devlieghere1-3/+3
Renames UBSanRuntime to InstrumentationRuntimeUBSan to be consistent with the directory structure and plugin name.
2020-01-21[lldb/Plugin] Rename TSanRuntime for consistency with plugin (NFC)Jonas Devlieghere1-3/+3
Renames TSanRuntime to InstrumentationRuntimeTSan to be consistent with the directory structure and plugin name.
2020-01-21[lldb/Plugin] Rename AddressSanitizerRuntime for consistency with plugin (NFC)Jonas Devlieghere1-3/+3
Renames AddressSanitizerRuntime to InstrumentationRuntimeASan to be consistent with the directory structure and plugin name.
2020-01-21[lldb/Initializers] Move all macOS initializers into PlatformMacOSXJonas Devlieghere1-26/+0
PlatformMacOSX is the main entry point to the plugin with the same name. This is part of a greater refactoring to auto generate the initializers. Differential revision: https://reviews.llvm.org/D73116
2020-01-17[lldb] Remove out of order OperatingSystemPython::Terminate call in ↵Raphael Isemann1-3/+0
SystemInitializerFull We already call it later in the method (which is in the right order as we Initialize it at the of the constructor).
2020-01-17[lldb] Add missing terminate calls to Python/Lua subsystemsRaphael Isemann1-0/+12
2020-01-16[LLDB] Add SymbolVendorWasm plugin for WebAssembly debuggingPaolo Severini1-0/+3
Add plugin class SymbolVendorWasm, with the logic to manage debug symbols for Wasm modules. Reviewers: clayborg, labath, aprantl, sbc100, teemperor Reviewed By: labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D72650
2020-01-15[LLDB] Add ObjectFileWasm plugin for WebAssembly debuggingPaolo Severini1-0/+3
Summary: This is the first in a series of patches to enable LLDB debugging of WebAssembly targets. Current versions of Clang emit (partial) DWARF debug information in WebAssembly modules and we can leverage this debug information to give LLDB the ability to do source-level debugging of Wasm code that runs in a WebAssembly engine. A way to do this could be to use the remote debugging functionalities provided by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not only to connect a debugger to a process running on a remote machine, but also to connect the debugger to a managed VM or script engine that runs locally, provided that the engine implements a GDB-remote stub that offers the ability to access the engine runtime internal state. To make this work, the GDB-remote protocol would need to be extended with a few Wasm-specific custom query commands, used to access aspects of the Wasm engine state (like the Wasm memory, Wasm local and global variables, and so on). Furthermore, the DWARF format would need to be enriched with a few Wasm-specific extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf. This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm module loaded in a debuggee process. It knows how to parse Wasm modules and store the Code section and the DWARF-specific sections. Reviewers: jasonmolenda, clayborg, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D71575
2019-12-19[lldb/Lua] Add Boilerplate for a Lua Script InterpreterJonas Devlieghere1-0/+8
This adds the boilerplate necessary to support the Lua script interpreter. The interpreter is not functional yet and just reports that it's not implemented. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html Differential revision: https://reviews.llvm.org/D71232
2019-12-13[lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHONJonas Devlieghere1-4/+4
This matches the naming scheme used by LLVM and all the other optional dependencies in LLDB. Differential revision: https://reviews.llvm.org/D71482
2019-12-10[lldb/Host] Use Host/Config.h entries instead of a global define.Jonas Devlieghere1-1/+1
As suggested by Pavel in a code review: > Can we replace this (and maybe python too, while at it) with a > Host/Config.h entry? A global definition means that one has to > recompile everything when these change in any way, whereas in > practice only a handful of files need this.. Differential revision: https://reviews.llvm.org/D71280
2019-10-17[ARC] Add SystemV ABITatyana Krasnukha1-1/+3
Differential Revision: https://reviews.llvm.org/D55724 llvm-svn: 375123
2019-09-26SystemInitializer: Define macros for experimental targets tooPavel Labath1-0/+2
llvm-svn: 372998
2019-09-26SystemInitializer: Use Targets.def to selectively initialize ABI pluginsPavel Labath1-56/+34
This avoids having to define additional macros in the cmake file, and and also makes the logic in the cpp files more compact. It is also easily extendible to other plugin types (instruction emulation?) that should only be initialized if the corresponding llvm target is built. Thanks to Ilya Birukov for pointing me to this file. llvm-svn: 372952
2019-09-25Have ABI plugins vend llvm MCRegisterInfo dataPavel Labath1-14/+43
Summary: I was recently surprised to learn that there is a total of 2 (two) users of the register info definitions contained in the ABI plugins. Yet, the defitions themselves span nearly 10kLOC. The two users are: - dwarf expression pretty printer - the mechanism for augmenting the register info definitions obtained over gdb-remote protocol (AugmentRegisterInfoViaABI) Both of these uses need the DWARF an EH register numbers, which is information that is already available in LLVM. This patch makes it possible to do so. It adds a GetMCRegisterInfo method to the ABI class, which every class is expected to implement. Normally, it should be sufficient to obtain the definitions from the appropriate llvm::Target object (for which I provide a utility function), but the subclasses are free to construct it in any way they deem fit. We should be able to always get the MCRegisterInfo object from llvm, with one important exception: if the relevant llvm target was disabled at compile time. To handle this, I add a mechanism to disable the compilation of ABI plugins based on the value of LLVM_TARGETS_TO_BUILD cmake setting. This ensures all our existing are able to create their MCRegisterInfo objects. The new MCRegisterInfo api is not used yet, but the intention is to make use of it in follow-up patches. Reviewers: jasonmolenda, aprantl, JDevlieghere, tatyana-krasnukha Subscribers: wuzish, nemanjai, mgorny, kbarton, atanasyan, lldb-commits Differential Revision: https://reviews.llvm.org/D67965 llvm-svn: 372862
2019-06-24[ABI] Implement Windows ABI for x86_64Alex Langford1-0/+3
Summary: Implement the ABI for WIndows-x86_64 including register info and calling convention. Handled nested struct returned in register (SysV doesn't have it supported) Reviewers: xiaobai, compnerd Reviewed By: compnerd Subscribers: labath, jasonmolenda, fedor.sergeev, mgorny, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62213 llvm-svn: 364216
2019-05-06Initialization: move InstructionEmulation to full initializationSaleem Abdulrasool1-0/+13
The debug server does not need to use the instruction emulation. This helps reduce the size of the final lldb-server binary by another ~100K (~1% savings). llvm-svn: 360067
2019-05-03ExpressionParser: only force link MCJIT when neededSaleem Abdulrasool1-0/+5
This was added to support FreeBSD. The inclusion of this header increases the size of `lldb-server` due to MCJIT being forcefully preserved. Conditionalise the inclusion to shared builds of LLVM which will allow for MCJIT to be stripped if unnecessary when performing static linking of tools. This shaves off ~28% of the binary size for lldb-server when linked with gold using `-ffunction-sections` and `-fdata-sections`. llvm-svn: 359944
2019-05-03Revert "Initialization: move InstructionEmulation to full initialization"Pavel Labath1-13/+0
This change is bogus. lldb-server definitely uses instruction emulation on some architectures. llvm-svn: 359862
2019-05-02Initialization: move InstructionEmulation to full initializationSaleem Abdulrasool1-0/+13
The debug server does not need to use the instruction emulation. This helps reduce the size of the final lldb-server binary by another ~100K (~1% savings). llvm-svn: 359832
2019-05-02Initialization: remove ObjectContainer from CommonSaleem Abdulrasool1-0/+8
This restructures the initialization path to move the ObjectContainer initialization into the *full* initialization path. This is not needed for the lldb-server initialization path. This helps strip off ~1MiB from the binary. llvm-svn: 359810
2019-04-24[SystemInitializerFull] Fix header sorting (NFC)Jonas Devlieghere1-2/+1
Made some changes downstream that touched the header sorting. llvm-svn: 359141
2019-04-10[NFC] Remove ASCII lines from commentsJonas Devlieghere1-2/+0
A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
2019-03-29[Python] Remove Python include from ScriptInterpreterPython.hJonas Devlieghere1-4/+0
This patch limits the scope of the python header to the implementation of the python script interpreter plugin. ScriptInterpreterPython is now an abstract interface that doesn't expose any Python specific types, and is implemented by the ScriptInterpreterPythonImpl. Differential revision: https://reviews.llvm.org/D59976 llvm-svn: 357307
2019-03-27[Platform] Remove Kalimba PlatformJonas Devlieghere1-3/+0
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
2019-03-26[Python] Remove dynamic indirectionJonas Devlieghere1-1/+0
Now that the Python plugin relies on the SWIG symbols, we no longer need to dynamically resolve these functions. llvm-svn: 357034
2019-03-25[ScriptInterpreterPython] Move SWIG initialization into the Python plugin (NFC)Jonas Devlieghere1-169/+1
Abstract initialization of the Python SWIG support in the Python plugin. llvm-svn: 356942
2019-02-21[Reproducers] Initialize reproducers before initializing the debugger.Jonas Devlieghere1-3/+2
As per the discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20190218/048007.html This commit implements option (3): > Go back to initializing the reproducer before the rest of the debugger. > The method wouldn't be instrumented and guarantee no other SB methods are > called or SB objects are constructed. The initialization then becomes part > of the replay. Differential revision: https://reviews.llvm.org/D58410 llvm-svn: 354631
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2019-01-11Introduce SymbolFileBreakpad and use it to fill symtabPavel Labath1-0/+3
Summary: This commit adds the glue code necessary to integrate the SymbolFileBreakpad into the plugin system. Most of the methods are stubbed out. The only method implemented method is AddSymbols, which parses the PUBLIC "section" of the breakpad "object file", and fills out the Module's symtab. To enable testing this, I've made two additional changes: - dump Symtab from the SymbolVendor class. The symtab was already being dumped as a part of the object file dump, but that happened before symbol vendor kicked in, so it did not reflect any symbols added there. - add ability to explicitly specify the external symbol file in lldb-test (so that the object file could be linked with the breakpad symbol file). To make things simpler, I've changed lldb-test from consuming multiple inputs (and dumping their symbols) to having it just process a single file per invocation. This was not a problem since everyone was using it that way already. Reviewers: clayborg, zturner, lemo, markmentovai, amccarth Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D56173 llvm-svn: 350924
2018-12-13Add missing Initialize/Terminate for Architecture pluginsTatyana Krasnukha1-0/+6
llvm-svn: 349036
2018-12-10Re-commit "Introduce ObjectFileBreakpad"Pavel Labath1-0/+3
This re-commits r348592, which was reverted due to a failing test on macos. The issue was that I was passing a null pointer for the "CreateMemoryInstance" callback when registering ObjectFileBreakpad, which caused crashes when attemping to load modules from memory. The correct thing to do is to pass a callback which always returns a null pointer (as breakpad files are never loaded in inferior memory). It turns out that there is only one test which exercises this code path, and it's mac-only, so I've create a new test which should run everywhere (except windows, as one cannot delete an executable which is being run). Unfortunately, this test still fails on linux for other reasons, but at least it gives us something to aim for. The original commit message was: This patch adds the scaffolding necessary for lldb to recognise symbol files generated by breakpad. These (textual) files contain just enough information to be able to produce a backtrace from a crash dump. This information includes: - UUID, architecture and name of the module - line tables - list of symbols - unwind information A minimal breakpad file could look like this: MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 FILE 0 /tmp/a.c FUNC 1010 10 0 _start 1010 4 4 0 1014 5 5 0 1019 5 6 0 101e 2 7 0 PUBLIC 1010 0 _start STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^ STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + STACK CFI 1014 .cfa: $rbp 16 + Even though this data would normally be considered "symbol" information, in the current lldb infrastructure it is assumed every SymbolFile object is backed by an ObjectFile instance. So, in order to better interoperate with the rest of the code (particularly symbol vendors). In this patch I just parse the breakpad header, which is enough to populate the UUID and architecture fields of the ObjectFile interface. The rough plan for followup patches is to expose the individual parts of the breakpad file as ObjectFile "sections", which can then be used by other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary information. Reviewers: clayborg, zturner, lemo, amccarth Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D55214 llvm-svn: 348773
2018-12-07Revert "Introduce ObjectFileBreakpad"Shafik Yaghmour1-3/+0
This reverts commit 5e056e624cc57bb22a4c29a70b522783c6242293. Reverting because this lldb cmake bot: http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/13712/ llvm-svn: 348629
2018-12-07Introduce ObjectFileBreakpadPavel Labath1-0/+3
Summary: This patch adds the scaffolding necessary for lldb to recognise symbol files generated by breakpad. These (textual) files contain just enough information to be able to produce a backtrace from a crash dump. This information includes: - UUID, architecture and name of the module - line tables - list of symbols - unwind information A minimal breakpad file could look like this: MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 FILE 0 /tmp/a.c FUNC 1010 10 0 _start 1010 4 4 0 1014 5 5 0 1019 5 6 0 101e 2 7 0 PUBLIC 1010 0 _start STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^ STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + STACK CFI 1014 .cfa: $rbp 16 + Even though this data would normally be considered "symbol" information, in the current lldb infrastructure it is assumed every SymbolFile object is backed by an ObjectFile instance. So, in order to better interoperate with the rest of the code (particularly symbol vendors). In this patch I just parse the breakpad header, which is enough to populate the UUID and architecture fields of the ObjectFile interface. The rough plan for followup patches is to expose the individual parts of the breakpad file as ObjectFile "sections", which can then be used by other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary information. Reviewers: clayborg, zturner, lemo, amccarth Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D55214 llvm-svn: 348592
2018-12-03[Reproducers] Change how reproducers are initialized.Jonas Devlieghere1-2/+6
This patch changes the way the reproducer is initialized. Rather than making changes at run time we now do everything at initialization time. To make this happen we had to introduce initializer options and their SB variant. This allows us to tell the initializer that we're running in reproducer capture/replay mode. Because of this change we also had to alter our testing strategy. We cannot reinitialize LLDB when using the dotest infrastructure. Instead we use lit and invoke two instances of the driver. Another consequence is that we can no longer enable capture or replay through commands. This was bound to go away form the beginning, but I had something in mind where you could enable/disable specific providers. However this seems like it adds very little value right now so the corresponding commands were removed. Finally this change also means you now have to control this through the driver, for which I replaced --reproducer with --capture and --replay to differentiate between the two modes. Differential revision: https://reviews.llvm.org/D55038 llvm-svn: 348152
2018-11-05Remove OCaml debugger pluginJonas Devlieghere1-6/+0
In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the OCaml debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54060 llvm-svn: 346159
2018-11-05Remove Java debugger pluginJonas Devlieghere1-9/+0
In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Java debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54059 llvm-svn: 346158
2018-11-05Remove Go debugger pluginJonas Devlieghere1-12/+1
In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Go debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54057 llvm-svn: 346157
2018-10-31[lldb] Introduce StackFrameRecognizer [take 3]Kuba Mracek1-1/+10
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
2018-10-31Revert r345686 due to build failuresKuba Mracek1-10/+1
llvm-svn: 345688
2018-10-31[lldb] Introduce StackFrameRecognizer [take 2]Kuba Mracek1-1/+10
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
2018-10-31Revert r345678 (build failure on Linux machines).Kuba Mracek1-10/+1
llvm-svn: 345680
2018-10-31[lldb] Introduce StackFrameRecognizerKuba Mracek1-1/+10
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
2018-10-11Upstreaming the BridgeOS device support and the Jason Molenda1-0/+3
LC_BUILD_VERSION load command handling - this commit is a combination of patches by Adrian Prantl and myself. llvm::Triple::BridgeOS isn't defined yet, so all references to that are currently commented out. Also update Xcode project file to build the NativePDB etc plugins. <rdar://problem/43353615> llvm-svn: 344209
2018-09-13Add a "scripted" breakpoint type to lldb.Jim Ingham1-1/+14
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
2018-05-25Move SystemInitializerFull header to source/APIAlex Langford1-1/+1
Summary: It seems to me that files in include/lldb/API/ are headers that should be exposed to liblldb users. Because SystemInitializerFull.h exposes details of lldb_private, I think having it there is not the right thing to do. Since it's only included from files in source/API, we should move it there and treat it as private. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D47342 llvm-svn: 333304
2018-05-24Move ObjectFile initialization out of SystemInitializerCommonPavel Labath1-0/+12
Summary: For lldb-server, it is sufficient to parse only the native object file format for its target OS (no other file can be loaded into a running process). This moves the object file initialization code into specific initializer classes: lldb-test and liblldb get all object files; lldb-server gets only one of them. For this to work, I've needed to create a special SystemInitializer for use in lldb-server, instead of it calling directly into the common one. This reduces the size of lldb-server by about 2%, which is not earth-shattering, but it's an easy win, and it helps. Reviewers: zturner, clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47250 llvm-svn: 333182