summaryrefslogtreecommitdiff
path: root/lldb/docs
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][docs] Update SB API design documentAlex Langford2023-05-161-8/+26
| | | | | | | The documentation should have been updated in 662548c82683. This updates it to be more accurate with the current design. Differential Revision: https://reviews.llvm.org/D150630
* [lldb] Define lldbassert based on NDEBUG instead of LLDB_CONFIGURATION_DEBUGJonas Devlieghere2023-05-161-2/+2
| | | | | | | | | | | Whether assertions are enabled or not is orthogonal to the build type which could lead to surprising behavior for lldbassert. Previously, when doing a debug build with assertions disabled, lldbassert would become a NOOP, rather than printing an error like it does in a release build. By definining lldbassert in terms of NDEBUG, it behaves like a regular assert when assertions are enabled, and like a soft assert. Differential revision: https://reviews.llvm.org/D150639
* [lldb] Fix lldb_assert -> lldbassert in docsJonas Devlieghere2023-05-151-3/+3
| | | | | | | Update the documentation to reference lldbassert rather than lldb_assert. The latter is the implementation, which shouldn't be used directly. Instead, users should use lldbassert which is the macro that expands to assert or lldb_assert depending on the build type.
* Add a new report_load_commands option to jGetLoadedDynamicLibrariesInfosJason Molenda2023-05-081-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jGetLoadedDynamicLibrariesInfos has a mode where it will list every binary in the process - the load address and filepath from dyld SPI, and the mach-o header and load commands from a scan by debugserver for perf reasons. With a large enough number of libraries, creating that StructuredData representation of all of this, and formatting it into an ascii string to send up to lldb, can grow debugserver's heap size too large for some environments. This patch adds a new report_load_commands:false boolean to the jGetLoadedDynamicLibrariesInfos packet, where debugserver will now only report the dyld SPI load address and filepath for all of the binaries. lldb can then ask for the detailed information on the process binaries in smaller chunks, and avoid debugserver having ever growing heap use as the number of binaries inevitably increases. This patch also removes a version of jGetLoadedDynamicLibrariesInfos for pre-iOS 10 and pre-macOS 10.12 systems where we did not use dyld SPI. We can't back compile to those OS builds any longer with modern Xcode. Finally, it removes a requirement in DynamicLoaderMacOS that the JSON reply from jGetLoadedDynamicLibrariesInfos include the mod_date field for each binary. This has always been reported as 0 in modern dyld, and is another reason for packet growth in the reply. debugserver still puts the mod_date field in its replies for interop with existing lldb's, but we will be able to remove it the field from debugserver's output after the next release cycle when this patch has had time to circulate. I'll add lldb support for requesting the load addresses only and splitting the request up into chunks in a separate patch. Differential Revision: https://reviews.llvm.org/D150158 rdar://107848326
* [LLDB] Add minimal support for the new Mojo languagewalter erquinigo2023-05-051-0/+1
| | | | Modular just announced a new language called Mojo. This patch adds an entry in the language list in LLDB for minimal support (e.g. being able to create a TypeSystem for this language). We will later add debug info entries when the language matures.
* Recognize `addressing_bits` kv in stop reply packetJason Molenda2023-05-041-0/+18
| | | | | | | | | | | | | If a remote stub provides the addressing_bits kv pair in the stop reply packet, update the Process address masks with that value as it possibly changes during the process runtime. This is an unusual situation, most likely a JTAG remote stub and some very early startup code that is setting up the page tables. Nearly all debug sessions will have a single address mask that cannot change during the lifetime of a Process. Differential Revision: https://reviews.llvm.org/D149803 rdar://61900565
* [docs] Hide collaboration and include graphs in doxygen docsTimm Bäder2023-05-041-3/+3
| | | | | | | They don't convey any useful information and make the documentation unnecessarily hard to read. Differential Revision: https://reviews.llvm.org/D149641
* [LLDB][docs] Remove outdated list of BuildbotsDavid Spickett2023-04-131-5/+0
| | | | This was out of date and the link to the lldb tag will always be up to date.
* Remove AArch64 out of MIPS watchpoint-skip, doc wp descriptionJason Molenda2023-04-121-6/+46
| | | | | | | | | | | | | | | | | | | Watchpoints from lldb-server are sent in the stop info packet as a `reason:watchpoint` and `description:asciihex` keys; the latter's asciihex has one to three integer values. This patch documents the purpose of those three different numbers, and clarifies the behavior on MIPS with the third number which is outside the range of any watched memory range means to silently skip the watchpoint. lldb was previously using this silently skip watchpoint behavior for AArch64 as well, but in the case of AArch64 we see a watchpoint address outside of a watched memory range when the write BEGINS before the watched memory range, but extends in to it. We don't want to silently skip these. Differential Revision: https://reviews.llvm.org/D147816 rdar://83996471
* [lldb][docs] Remove mentions of MIPS64 Linux debugDavid Spickett2023-03-132-4/+3
| | | | This was removed in ce03a862372a6f36d2fcf80dc80052aa155fcae8.
* [LLDB] Expose several methods in SBWatchpointDan Liew2023-03-011-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the following methods: * `GetType()` * `GetWatchValueKind()` * `GetWatchSpec()` * `IsWatchingReads()` * `IsWatchingWrites()` These mostly expose methods that `lldb_private::Watchpoint` already had. Tests are included that exercise these new methods. The motivation for exposing these are as follows: * `GetType()` - With this information and the address from a watchpoint it is now possible to construct an SBValue from an SBWatchpoint. Previously this wasn't possible. The included test case illustrates doing this. * `GetWatchValueKind()` - This allows the caller to determine whether the watchpoint is a variable watchpoint or an expression watchpoint. A new enum (`WatchpointValueKind`) has been introduced to represent the return values. Unfortunately the name `WatchpointKind` was already taken. * `GetWatchSpec()` - This allows (at least for variable watchpoints) to use a sensible name for SBValues created from an SBWatchpoint. * `IsWatchingReads()` - This allow checking if a watchpoint is monitoring read accesses. * `IsWatchingWRites()` - This allow checking if a watchpoint is monitoring write accesses. rdar://105606978 Reviewers: jingham, mib, bulbazord, jasonmolenda, JDevlieghere Differential Revision: https://reviews.llvm.org/D144937
* Add usage info for backtick to the lldb tutorial.Jim Ingham2023-02-021-4/+17
|
* [lldb] Fix typos and update "GDB To LLDB Command Map" to be a bit more clearSaagar Jha2023-01-151-26/+24
| | | | | | | | | | I've gone through the GDB To LLDB Command Map and tried to improve it: - Fix obvious typos (e.g. <cope> → <code>) - Wrap code and program names in <code> tags - Reword a couple parts where (IMHO) the phrasing could be a bit better Differential revision: https://reviews.llvm.org/D28758
* [lldb] Add lldb-server targets to build docsDavid Spickett2023-01-121-3/+13
| | | | | | | | | | | | | | | | | | | The current doc has people just do "ninja lldb" which is not incorrect, it does build lldb. However it does not build lldb-server. So you can't just "lldb some-binary" and expect it to work. I've updated the instructions to reflect that most of the time you'll want both lldb and lldb-server. Though there is a use case for building just lldb. I'm assuming Mac OS (where you have debugserver) and if you only wanted to do remote debug. Fixes #59575 Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D140385
* [lldb] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata2023-01-071-1/+1
| | | | | | | | | | | This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to clean up the "using" declarations, #include "llvm/ADT/Optional.h", etc. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
* Launch state discoverable in Darwin, use for SafeToCallFunctionsJason Molenda2022-12-131-0/+18
| | | | | | | | | | | | | | | | | | | | | | | The dynamic linker on Darwin, dyld, can provide status of the process state for a few significant points early on, most importantly, when libSystem has been initialized and it is safe to call functions behind the scenes. Pipe this information up from debugserver to DynamicLoaderMacOS, for the DynamicLoader::IsFullyInitialized() method, then have Thread::SafeToCallFunctions use this information. Finally, for the two utility functions in the AppleObjCRuntimeV2 LanguageRuntime plugin that I was fixing, call this method before running our utility functions to collect the list of objc classes registered in the runtime. User expressions will still be allowed to run any time - we assume the user knows what they are doing - but these two additional utility functions that they are unaware of will be limited by this state. Differential Revision: https://reviews.llvm.org/D139054 rdar://102436092 can probably make function calls.
* [lldb] Make callback-based formatter matching available from the CLI.Jorge Gorbe Moya2022-11-101-0/+33
| | | | | | | | | | | This change adds a `--recognizer-function` (`-R`) to `type summary add` and `type synth add` that allows users to specify that the names in the command are not type names but python function names. It also adds an example to lldb/examples, and a section in the data formatters documentation on how to use recognizer functions. Differential Revision: https://reviews.llvm.org/D137000
* [lldb] Document QSetDetachOnError packetFelipe de Azevedo Piovezan2022-11-011-0/+17
| | | | | | The packet was introduced in 106d02866d4d54b09c08e6a12915dba58e709294. Differential Revision: https://reviews.llvm.org/D136958
* [lldb][Docs][NFC] Fix sphinx warnings/errors for LLDB docsMichael Buch2022-10-283-13/+11
| | | | | | Ran `ninja docs-lldb-html` and made sure the docs are fixed. Differential Revision: https://reviews.llvm.org/D136766
* [LLDB] Correct env vars for Android port selectionDavid Spickett2022-10-261-1/+1
| | | | | | These should have "LOCAL" in them. First added in 1e210abf9925ad08fb7c79894b4ec5ef8f0ef173.
* [LLDB] Make remote-android local ports configurableLuka Markušić2022-10-261-0/+5
| | | | | | | | | | | The local ports for `platform connect` and `attach` were always random, this allows the user to configure them. This is useful for debugging a truly remote android (when the android in question is connected to a remote server). There is a lengthier discussion on github - https://github.com/llvm/llvm-project/issues/58114 Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D136465
* [LLDB][Docs][NFC] Fix formatting in -gmodules documentationMichael Buch2022-10-251-2/+5
|
* [LLDB] Add missing breaks to current frame row in command mapDavid Spickett2022-10-251-0/+2
| | | | Without these it was rendering as one line for all three commands.
* [LLDB] Add "frame select" as equivalent of GDB's "frame" commandDavid Spickett2022-10-071-0/+14
| | | | | | | | | This is useful for answering the question "where am I?" and is surprisingly difficult to figure out without just doing another step command. Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D134873
* [lldb][test] 1 - Don't do test-replication for gmodules debug_info variantMichael Buch2022-09-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, by default LLDB runs an API test with 3 variants, one of which, depending on platform, is `gmodules`. However, most tests don't actually make use of any specific `gmodules` feature since they compile a single `main.cpp` file without imporint types from other modules. Instead of running all tests an extra time with `-gmodules` enabled, we plan to test `gmodules` features with dedicated API tests that explicitly opt-into compiling with `-gmodules`. One of the main benefits of this will be a reduction in total API test-suite run-time (by around 1/3). This patch adds a flag to `debug_info_categories` that indicates whether a category is eligible to be replicated by `lldbtest`. Keeping `gmodules` a debug-info category is desirable because `builder.py` knows how to inject the appropriate Makefile flags into the build command for debug-info categories already. Whereas for non-debug-info categories we'd have to teach it how to. The category is inferred from the test-name debug-info suffix currently. Differential Revision: https://reviews.llvm.org/D134524
* [lldb] Fixed a number of typosGabriel Ravier2022-09-131-1/+1
| | | | | | | | | | | | | | | | I went over the output of the following mess of a command: (ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less) and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Differential revision: https://reviews.llvm.org/D131122
* Document some of the clang-specific DWARF extensions supported by LLDBAdrian Prantl2022-09-092-0/+136
| | | | | | | This patch adds a new page to the LLDB documentation that documents, among other things the -gmodules debug info format. Differential Revision: https://reviews.llvm.org/D133519
* You can't use lldb.target in a frame recognizer.Jim Ingham2022-09-061-1/+2
|
* [lldb][docs] Fix formatting in fuzzing docChelsea Cassanova2022-08-261-0/+5
| | | | | | | The page for fuzzing LLDB had incorrectly formatted code, this commit fixes that. Differential revision: https://reviews.llvm.org/D132775
* [lldb][docs] Add documentation for LLDB fuzzersChelsea Cassanova2022-08-262-0/+69
| | | | | | | | This commit adds a new page to the LLDB HTML documentation for the LLDB fuzzers. The page primarily explains what the fuzzers are as well as how to build them, run them and investigate and reproduce bugs. Differential revision: https://reviews.llvm.org/D132148
* [lldb] Fix formatting in python-reference.rstDave Lee2022-08-071-2/+2
|
* [lldb] Add assertStopReason helper functionJonas Devlieghere2022-08-031-4/+6
| | | | | | | | | | | | | | | | | | Add a function to make it easier to debug a test failure caused by an unexpected stop reason. This is similar to the assertState helper that was added in ce825e46743b. Before: self.assertEqual(stop_reason, lldb.eStopReasonInstrumentation) AssertionError: 5 != 10 After: self.assertStopReason(stop_reason, lldb.eStopReasonInstrumentation) AssertionError: signal (5) != instrumentation (10) Differential revision: https://reviews.llvm.org/D131083
* Allow firmware binaries to be specified only by load addressJason Molenda2022-08-021-0/+6
| | | | | | | | | | | | | | | | | | | | Add support to Mach-O corefiles and to live gdb remote serial protocol connections for the corefile/remote stub to provide a list of load addresses of binaries that should be found & loaded by lldb, and nothing else. lldb will try to parse the binary out of memory, and if it can find a UUID, try to find a binary & its debug information based on the UUID, falling back to using the memory image if it must. A bit of code unification from three parts of lldb that were loading individual binaries already, so there is a shared method in DynamicLoader to handle all of the variations they were doing. Re-landing this with a uuid_is_null() implementation added to Utility/UuidCompatibility.h for non-Darwin systems. Differential Revision: https://reviews.llvm.org/D130813 rdar://94249937 rdar://94249384
* Revert "Allow firmware binaries to be specified only by load address"Jason Molenda2022-08-021-6/+0
| | | | | | | This reverts commit d8879fba8825b9799166ba0ea552d4027bfb8ad1. Debian bot failure; I included <uuid/uuid.h> to get uuid_is_null() but don't get it there. Will memcmp or whatever & recommit.
* Allow firmware binaries to be specified only by load addressJason Molenda2022-08-021-0/+6
| | | | | | | | | | | | | | | | | Add support to Mach-O corefiles and to live gdb remote serial protocol connections for the corefile/remote stub to provide a list of load addresses of binaries that should be found & loaded by lldb, and nothing else. lldb will try to parse the binary out of memory, and if it can find a UUID, try to find a binary & its debug information based on the UUID, falling back to using the memory image if it must. A bit of code unification from three parts of lldb that were loading individual binaries already, so there is a shared method in DynamicLoader to handle all of the variations they were doing. Differential Revision: https://reviews.llvm.org/D130813 rdar://94249937 rdar://94249384
* Update docs to note lzfse open source implementationJason Molenda2022-07-191-1/+4
|
* [lldb] Delete more mydir references (NFC)Dave Lee2022-07-101-13/+3
|
* [lldb] Cleanup Python API reference files after building the docsJonas Devlieghere2022-06-161-4/+11
| | | | | | | | | | | | | | | The sphinx-automodapi extension requires that the generated RST files live next to the index file. This means that we generate them in the source directory rather than the build directory. This patch ensures these files are removed again when sphinx finishes its build. The proper solution to this problem would be to move everything in the doc folder from the source directory to the build directory before generating the docs. I believe that old RST files being kept around is the reason that the Python API references on the website isn't getting updated. This patch is meant as a speculative fix and a way to confirm that.
* [lldb] Remove references to epydoc from the documentationJonas Devlieghere2022-06-161-4/+1
| | | | | We no longer rely on epydoc but instead use a sphinx plugin to generate the Python API reference.
* [trace][intelpt] Support system-wide tracing [21] - Support long numbers in JSONWalter Erquinigo2022-06-161-7/+7
| | | | | | | | | | | | | llvm's JSON parser supports 64 bit integers, but other tools like the ones written in JS don't support numbers that big, so we need to represent these possibly big numbers as a string. This diff uses that to represent addresses and tsc zero. The former is printed in hex for and the latter in decimal string form. The schema was updated mentioning that. Besides that, I fixed some remaining issues and now all test pass. Before I wasn't running all tests because for some reason my computer reverted perf_paranoid to 1. Differential Revision: https://reviews.llvm.org/D127819
* [trace][intelpt] Support system-wide tracing [20] - Rename some fields in ↵Walter Erquinigo2022-06-162-19/+14
| | | | | | | | | | | the schema As discusses offline with @jj10305, we are updating some naming used throughout the code, specially in the json schema - traceBuffer -> iptTrace - core -> cpu Differential Revision: https://reviews.llvm.org/D127817
* [trace][intelpt] Support system-wide tracing [18] - some more improvementsWalter Erquinigo2022-06-161-4/+0
| | | | | | | | | | | | | | This applies the changes requested for diff 12. - use DenseMap<ConstString, _> instead of std::unordered_map<ConstString, _>, which is more idiomatic and possibly performant. - deduplicate some code in Trace.cpp by using helper functions for fetching in maps - stop using size and offset when fetching binary data, because we in fact read the entire buffers all the time. If we ever need streaming, we can implement it then. Now, the size is used only to check that we are getting the correct amount of data. This is useful because in some cases determining the size doesn't involve fetching the actual data. - added back the x86_64 macro to the perf tests - added more documentation - simplified some file handling - fixed some comments Differential Revision: https://reviews.llvm.org/D127752
* [trace][intelpt] Support system-wide tracing [12] - Support multi-core trace ↵Walter Erquinigo2022-06-152-12/+10
| | | | | | | | | | | | | | | | | | | | | load and save :q! This diff is massive, but it's because it connects the client with lldb-server and also ensures that the postmortem case works. - Flatten the postmortem trace schema. The reason is that the schema has become quite complex due to the new multicore case, which defeats the original purpose of having a schema that could work for every trace plug-in. At this point, it's better that each trace plug-in defines it's own full schema. This means that the only common field is "type". -- Because of this new approach, I merged the "common" trace load and saving functionalities into the IntelPT one. This simplified the code quite a bit. If we eventually implement another trace plug-in, we can see then what we could reuse. -- The new schema, which is flattened, has now better comments and is parsed better. A change I did was to disallow hex addresses, because they are a bit error prone. I'm asking now to print the address in decimal. -- Renamed "intel" to "GenuineIntel" in the schema because that's what you see in /proc/cpuinfo. - Implemented reading the context switch trace data buffer. I had to do some refactors to do that cleanly. -- A major change that I did here was to simplify the perf_event circular buffer reading logic. It was too complex. Maybe the original Intel author had something different in mind. - Implemented all the necessary bits to read trace.json files with per-core data. - Implemented all the necessary bits to save to disk per-core trace session. - Added a test that ensures that parsing and saving to disk works. Differential Revision: https://reviews.llvm.org/D126015
* [trace][intelpt] Support system-wide tracing [10] - Return warnings and tsc ↵Walter Erquinigo2022-06-151-16/+13
| | | | | | | | | | | | information from lldb-server. - Add a warnings field in the jLLDBGetState response, for warnings to be delivered to the client for troubleshooting. This removes the need to silently log lldb-server's llvm::Errors and not expose them easily to the user - Simplify the tscPerfZeroConversion struct and schema. It used to extend a base abstract class, but I'm doubting that we'll ever add other conversion mechanisms because all modern kernels support perf zero. It is also the one who is supposed to work with the timestamps produced by the context switch trace, so expecting it is imperative. - Force tsc collection for cpu tracing. - Add a test checking that tscPerfZeroConversion is returned by the GetState request - Add a pre-check for cpu tracing that makes sure that perf zero values are available. Differential Revision: https://reviews.llvm.org/D125932
* [trace][intelpt] Support system-wide tracing [9] - Collect and return ↵Walter Erquinigo2022-06-151-0/+2
| | | | | | | | | | | | | | context switch traces - Add collection of context switches per cpu grouped with the per-cpu intel pt traces. - Move the state handling from the interl pt trace class to the PerfEvent one. - Add support for stopping and enabling perf event groups. - Return context switch entries as part of the jLLDBTraceGetState response. - Move the triggers of whenever the process stopped or resumed. Now the will-resume notification is in a better location, which will ensure that we'll capture the instructions that will be executed. - Remove IntelPTSingleBufferTraceUP. The unique pointer was useless. - Add unit tests Differential Revision: https://reviews.llvm.org/D125897
* [lldb] Add missing UTF-8 char basic type entriesLuís Ferreira2022-06-131-1/+1
| | | | | | | | D120690 introduced `eBasicTypeChar8` but missed proper documentation order. This also introduces the missing bindings data on Swig, which should correspond with the documented information. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D116136
* [LLDB][Docs] Fix formatting of example code-blockAdrian Prantl2022-06-101-0/+1
| | | | | | | | | | Tested by building the docs-lldb-html target and confirming the code-block renders properly with the fix. Patch by Michael Buch! Differential Revision: https://reviews.llvm.org/D127437
* [lldb] Add a reference to the "On Demand Symbols" docs.Jonas Devlieghere2022-06-091-0/+1
| | | | | | Include a reference to the documentation for "on demand symbols" in the documentation index. This will ensure the page shows up in the side bar on the website.
* [lldb] Add table with custom LLDB asserts to the docsJonas Devlieghere2022-06-091-3/+14
| | | | | | Add table with custom LLDB asserts to the documentation. Differential revision: https://reviews.llvm.org/D127410
* [lldb] Fix code blocks in docs/use/intel_pt.rstJonas Devlieghere2022-06-091-0/+20
|