aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBDebugger.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-10-07[lldb] Add support for unique target ids (#160736)Janet Yang1-0/+11
### Summary Add support for unique target ids per Target instance. This is needed for upcoming changes to allow debugger instances to be shared across separate DAP instances for child process debugging. We want the IDE to be able to attach to existing targets in an already runny lldb-dap session, and having a unique ID per target would make that easier. Each Target instance will have its own unique id, and uses a function-local counter in `TargetList::CreateTargetInternal` to assign incremental unique ids. ### Tests Added several unit tests to test basic functionality, uniqueness of targets, and target deletion doesn't affect the uniqueness. ``` bin/lldb-dotest -p TestDebuggerAPI ```
2025-04-26[LLDB][Telemetry] Collect telemetry from client when allowed. (#129728)Vy Nguyen1-0/+11
This patch is slightly different from other impl in that we dispatch client-telemetry via a different helper method. This is to make it easier for vendor to opt-out (simply by overriding the method to do nothing). There is also a configuration option to disallow collecting client telemetry. --------- Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-04-08[LLDB][NFC] Remove Debugger dependency in SystemLifetimeManager (#134383)Dmitry Vasilyev1-40/+1
It reduces the memory usage in lldb-server.
2025-02-19[lldb] Make GetOutputStreamSP and GetErrorStreamSP protected (#127682)Jonas Devlieghere1-6/+6
This makes GetOutputStreamSP and GetErrorStreamSP protected members of Debugger. Users who want to print to the debugger's stream should use GetAsyncOutputStreamSP and GetAsyncErrorStreamSP instead and the few remaining stragglers have been migrated.
2025-02-12[lldb] Remove Debugger::Get{Output,Error}Stream (NFC) (#126821)Jonas Devlieghere1-18/+10
Remove Debugger::GetOutputStream and Debugger::GetErrorStream in preparation for replacing both with a new variant that needs to be locked and hence can't be handed out like we do right now. The patch replaces most uses with GetAsyncOutputStream and GetAsyncErrorStream respectively. There methods return new StreamSP objects that automatically get flushed on destruction. See #126630 for more details.
2025-02-11[lldb] Fix ubsan violation with plugin loading (#126652)Keith Smiley1-1/+1
This typedef doesn't match the signature below, specifically the signature takes a `lldb:SBDebugger` vs this was defined as `lldb:SBDebugger&`. ``` lldb/source/API/SBDebugger.cpp:199:13: runtime error: call to function lldb::PluginInitialize(lldb::SBDebugger) through pointer to incorrect function type 'bool (*)(lldb::SBDebugger &)' .../CustomPlugin.cpp:134: note: lldb::PluginInitialize(lldb::SBDebugger) defined here ```
2024-12-16[lldb] Use the terminal height for paging editline completions (#119914)Jonas Devlieghere1-0/+13
Currently, we arbitrarily paginate editline completions to 40 elements. On large terminals, that leaves some real-estate unused. On small terminals, it's pretty annoying to not see the first completions. We can address both issues by using the terminal height for pagination. This builds on the improvements of #116456.
2024-11-17Fix statistics dump to report per-target (#113723)jeffreytan811-0/+6
"statistics dump" currently report the statistics of all targets in debugger instead of current target. This is wrong because there is a "statistics dump --all-targets" option that supposed to include everything. This PR fixes the issue by only report statistics for current target instead of all. It also includes the change to reset statistics debug info/symbol table parsing/indexing time during debugger destroy. This is required so that we report current statistics if we plan to reuse lldb/lldb-dap across debug sessions --------- Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
2024-09-27[lldb] Inline expression evaluator error visualization (#106470)Adrian Prantl1-0/+6
This patch is a reworking of Pete Lawrence's (@PortalPete) proposal for better expression evaluator error messages: https://github.com/llvm/llvm-project/pull/80938 Before: ``` $ lldb -o "expr a+b" (lldb) expr a+b error: <user expression 0>:1:1: use of undeclared identifier 'a' a+b ^ error: <user expression 0>:1:3: use of undeclared identifier 'b' a+b ^ ``` After: ``` (lldb) expr a+b ^ ^ │ ╰─ error: use of undeclared identifier 'b' ╰─ error: use of undeclared identifier 'a' ``` This eliminates the confusing `<user expression 0>:1:3` source location and avoids echoing the expression to the console again, which results in a cleaner presentation that makes it easier to grasp what's going on. You can't see it here, bug the word "error" is now also in color, if so desired. Depends on https://github.com/llvm/llvm-project/pull/106442.
2024-09-27Revert "[lldb] Inline expression evaluator error visualization (#106470)"Adrian Prantl1-6/+0
This reverts commit 49372d1cccf50f404d52d40ae4b663db5604eb2c.
2024-09-27[lldb] Inline expression evaluator error visualization (#106470)Adrian Prantl1-0/+6
This patch is a reworking of Pete Lawrence's (@PortalPete) proposal for better expression evaluator error messages: https://github.com/llvm/llvm-project/pull/80938 Before: ``` $ lldb -o "expr a+b" (lldb) expr a+b error: <user expression 0>:1:1: use of undeclared identifier 'a' a+b ^ error: <user expression 0>:1:3: use of undeclared identifier 'b' a+b ^ ``` After: ``` (lldb) expr a+b ^ ^ │ ╰─ error: use of undeclared identifier 'b' ╰─ error: use of undeclared identifier 'a' ``` This eliminates the confusing `<user expression 0>:1:3` source location and avoids echoing the expression to the console again, which results in a cleaner presentation that makes it easier to grasp what's going on. You can't see it here, bug the word "error" is now also in color, if so desired. Depends on https://github.com/llvm/llvm-project/pull/106442.
2024-09-09[NFC] Add explicit #include llvm-config.h where its macros are used, lldb ↵Daniil Fukalov1-0/+1
part. (#107603) (this is lldb part) Without these explicit includes, removing other headers, who implicitly include llvm-config.h, may have non-trivial side effects. For example, `clangd` may report even `llvm-config.h` as "no used" in case it defines a macro, that is explicitly used with #ifdef. It is actually amplified with different build configs which use different set of macros.
2024-09-05[lldb] Make deep copies of Status explicit (NFC) (#107170)Adrian Prantl1-1/+1
2024-09-05[lldb] Make conversions from llvm::Error explicit with Status::FromEr… ↵Adrian Prantl1-1/+1
(#107163) …ror() [NFC]
2024-08-27[lldb] Turn lldb_private::Status into a value type. (#106163)Adrian Prantl1-24/+28
This patch removes all of the Set.* methods from Status. This cleanup is part of a series of patches that make it harder use the anti-pattern of keeping a long-lives Status object around and updating it while dropping any errors it contains on the floor. This patch is largely NFC, the more interesting next steps this enables is to: 1. remove Status.Clear() 2. assert that Status::operator=() never overwrites an error 3. remove Status::operator=() Note that step (2) will bring 90% of the benefits for users, and step (3) will dramatically clean up the error handling code in various places. In the end my goal is to convert all APIs that are of the form ` ResultTy DoFoo(Status& error) ` to ` llvm::Expected<ResultTy> DoFoo() ` How to read this patch? The interesting changes are in Status.h and Status.cpp, all other changes are mostly ` perl -pi -e 's/\.SetErrorString/ = Status::FromErrorString/g' $(git grep -l SetErrorString lldb/source) ` plus the occasional manual cleanup.
2024-08-06[lldb][debuginfod] Fix the DebugInfoD PR that caused issues when working ↵Kevin Frei1-5/+8
with stripped binaries (#99362) @walter-erquinigo found the the [PR with testing and a fix for DebugInfoD](https://github.com/llvm/llvm-project/pull/98344) caused an issue when working with stripped binaries. The issue is that when you're working with split-dwarf, there are *3* possible files: The stripped binary the user is debugging, the "only-keep-debug" *or* unstripped binary, plus the `.dwp` file. The debuginfod plugin should provide the unstripped/OKD binary. However, if the debuginfod plugin fails, the default symbol locator plugin will just return the stripped binary, which doesn't help. So, to address that, the SymbolVendorELF code checks to see if the SymbolLocator's ExecutableObjectFile request returned the same file, and bails if that's the case. You can see the specific diff as the second commit in the PR. I'm investigating adding a test: I can't quite get a simple repro, and I'm unwilling to make any additional changes to Makefile.rules to this diff, for Pavlovian reasons.
2024-07-15[LLDB] Revert #98351 and #98344walter erquinigo1-8/+5
This reverts commit 2fa1220a37a3f55b76a29803d8333b3a3937d53a. This reverts commit b9496a74eb4029629ca2e440c5441614e766f773. The patch #98344 causes a crash in LLDB when parsing some files like `numpy.libs/libgfortran-daac5196.so.5.0.0` on graviton (you can download it in https://drive.google.com/file/d/12ygLjJwWpzdYsrzBPp1JGiFHxcgM0-XY/view?usp=drive_link if you want to troubleshoot yourself). The assert that is hit is the following: ``` llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2452: std::pair<unsigned int, std::map<long unsigned int, lldb_private::AddressClass> > ObjectFileELF::ParseSymbolTable(lldb_private::Symtab*, lldb::user_id_t, lldb_private::Section*): Assertion `strtab->GetObjectFile() == this' failed. [383588:383636:20240716,025305.572639:ERROR crashpad_client_linux.cc:780] Crashpad isn't enabled ``` This object file doesn't have apparently a strings table but LLDB still tries to process it due to the code that is being reverted.
2024-07-10[lldb] DebugInfoD tests & fixes (but with dwp testing disabled) (#98344)Kevin Frei1-5/+8
This is all the tests and fixes I've had percolating since my first attempt at this in January. After 6 months of trying, I've given up on adding the ability to test DWP files in LLDB API tests. I've left both the tests (disabled) and the changes to Makefile.rules in place, in the hopes that someone who can configure the build bots will be able to enable the tests once a non-borked dwp tool is widely available. Other than disabling the DWP tests, this continues to be the same diff that I've tried to land and [not](https://github.com/llvm/llvm-project/pull/90622) [revert](https://github.com/llvm/llvm-project/pull/87676) [five](https://github.com/llvm/llvm-project/pull/86812) [times](https://github.com/llvm/llvm-project/pull/85693) [before](https://github.com/llvm/llvm-project/pull/96802). There are a couple of fixes that the testing exposed, and I've abandoned the DWP tests because I want to get those fixes finally upstreamed, as without them DebugInfoD is less useful.
2024-07-08Revert "[LLDB] DebugInfoD tests: attempt to fix Fuchsia build" (#98101)Kevin Frei1-8/+5
Reverts llvm/llvm-project#96802 Attempt #5 fails. It's been 6 months. I despise Makefile.rules and have no ability to even *detect* these failures without _landing_ a diff. In the mean time, we have no testing for DWP files at all (and a regression that was introduced, that I fix with this diff) so I'm going to just remove some of the tests and try to land it again, but with less testing I guess.
2024-07-08[LLDB] DebugInfoD tests: attempt to fix Fuchsia build (#96802)Kevin Frei1-5/+8
This is the same diff I've put up at many times before. I've been trying to add some brand new functionality to the LLDB test infrastucture (create split-dwarf files!), and we all know that no good deed goes unpunished. The last attempt was reverted because it didn't work on the Fuchsia build. There are no code differences between this and [the](https://github.com/llvm/llvm-project/pull/90622) [previous](https://github.com/llvm/llvm-project/pull/87676) [four](https://github.com/llvm/llvm-project/pull/86812) [diffs](https://github.com/llvm/llvm-project/pull/85693) landed & reverted (due to testing infra failures). The only change in this one is the way `dwp` is being identified in `Makefile.rules`. Thanks to @petrhosek for helping me figure out how the fuchsia builders are configured. I now prefer to use llvm-dwp and fall back to gnu's dwp if the former isn't found. Hopefully this will work everywhere it needs to.
2024-06-25Reapply PR/87550 (again) (#95571)Vy Nguyen1-0/+4
New fixes: - properly init the `std::optional<std::vector>` to an empty vector as opposed to `{}` (which was effectively `std::nullopt`). --------- Co-authored-by: Vy Nguyen <oontvoo@users.noreply.github.com>
2024-06-07Revert "Reapply PR/87550 (#94625)"Felipe de Azevedo Piovezan1-4/+0
This reverts commit 35fa2ded2ac52151be22c206fc92b983d1fd8e30. It broke the LLDB bots on green dragon
2024-06-07Reapply PR/87550 (#94625)Vy Nguyen1-0/+4
Re-apply https://github.com/llvm/llvm-project/pull/87550 with fixes. Details: Some tests in fuchsia failed because of the newly added assertion. This was because `GetExceptionBreakpoint()` could be called before `g_dap.debugger` was initted. The fix here is to just lazily populate the list in GetExceptionBreakpoint() rather than assuming it's already been initted. (There is some nuisance here because we can't simply just populate it in DAP::DAP(), which is a global ctor and is called before `SBDebugger::Initialize()` is called. )
2024-05-29Revert "[lldb][lldb-dap] Cleanup breakpoint filters." (#93739)gulfemsavrun1-4/+0
Reverts llvm/llvm-project#87550 because it broke `TestDAP*` lldb tests. https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64-rbe/b8746585790559468897/overview
2024-05-29[lldb][lldb-dap] Cleanup breakpoint filters. (#87550)Vy Nguyen1-0/+4
Details: - remove Swift breakpoint filter because this version of LLDB does not support Swift. - only return objc filters when working on macos.
2024-05-22Revert "[lldb] Added Debuginfod tests and fixed a couple issues" (#93094)Daniel Thornburgh1-8/+5
Reverts llvm/llvm-project#92572 due to Fuchsia CI breakages (using CLI tools in tests that weren't necessarily built).
2024-05-22[lldb] Added Debuginfod tests and fixed a couple issues (#92572)Kevin Frei1-5/+8
Here we go with attempt number five. Again, no changes to the LLDB code diff, which has been reviewed several times. For the tests, I added a `@skipIfCurlSupportMissing` annotation so that the Debuginfod mocked server stuff won't run, and I also disabled non-Linux/FreeBSD hosts altogether, as they fail for platform reasons on macOS and Windows. In addition, I updated the process for extracting the GNU BuildID to no create a target, per some feedback on the previous diff. For reference, previous PR's (landed, backed out after the fact for various reasons) #90622, #87676, #86812, #85693 --------- Co-authored-by: Kevin Frei <freik@meta.com>
2024-05-20SBDebugger: Add new APIs `AddDestroyCallback` and `RemoveDestroyCallback` ↵royitaqi1-0/+20
(#89868) # Motivation Individual callers of `SBDebugger::SetDestroyCallback()` might think that they have registered their callback and expect it to be called when the debugger is destroyed. In reality, only the last caller survives, and all previous callers are forgotten, which might be a surprise to them. Worse, if this is called in a race condition, which callback survives is less predictable, which may case confusing behavior elsewhere. # This PR Allows multiple destroy callbacks to be registered and all called when the debugger is destroyed. **EDIT**: Adds two new APIs: `AddDestroyCallback()` and `ClearDestroyCallback()`. `SetDestroyCallback()` will first clear then add the given callback. Tests are added for the new APIs. ## Tests ``` bin/llvm-lit -sv ../external/llvm-project/lldb/test/API/python_api/debugger/TestDebuggerAPI.py ``` ## (out-dated, see comments below) Semantic change to `SetDestroyCallback()` ~~Currently, the method overwrites the old callback with the new one. With this PR, it will NOT overwrite. Instead, it will hold on to both. Both callbacks get called during destroy.~~ ~~**Risk**: Although the documentation of `SetDestroyCallback()` (see [C++](https://lldb.llvm.org/cpp_reference/classlldb_1_1SBDebugger.html#afa1649d9453a376b5c95888b5a0cb4ec) and [python](https://lldb.llvm.org/python_api/lldb.SBDebugger.html#lldb.SBDebugger.SetDestroyCallback)) doesn't really specify the behavior, there is a risk: if existing call sites rely on the "overwrite" behavior, they will be surprised because now the old callback will get called. But as the above said, the current behavior of "overwrite" itself might be unintended, so I don't anticipate users to rely on this behavior. In short, this risk might be less of a problem if we correct it sooner rather than later (which is what this PR is trying to do).~~ ## (out-dated, see comments below) Implementation ~~The implementation holds a `std::vector<std::pair<callback, baton>>`. When `SetDestroyCallback()` is called, callbacks and batons are appended to the `std::vector`. When destroy event happen, the `(callback, baton)` pairs are invoked FIFO. Finally, the `std::vector` is cleared.~~ # (out-dated, see comments below) Alternatives considered ~~Instead of changing `SetDestroyCallback()`, a new method `AddDestroyCallback()` can be added, which use the same `std::vector<std::pair<>>` implementation. Together with `ClearDestroyCallback()` (see below), they will replace and deprecate `SetDestroyCallback()`. Meanwhile, in order to be backward compatible, `SetDestroyCallback()` need to be updated to clear the `std::vector` and then add the new callback. Pros: The end state is semantically more correct. Cons: More steps to take; potentially maintaining an "incorrect" behavior (of "overwrite").~~ ~~A new method `ClearDestroyCallback()` can be added. Might be unnecessary at this point, because workflows which need to set then clear callbacks may exist but shouldn't be too common at least for now. Such method can be added later when needed.~~ ~~The `std::vector` may bring slight performance drawback if its implementation doesn't handle small size efficiently. However, even if that's the case, this path should be very cold (only used during init and destroy). Such performance drawback should be negligible.~~ ~~A different implementation was also considered. Instead of using `std::vector`, the current `m_destroy_callback` field can be kept unchanged. When `SetDestroyCallback()` is called, a lambda function can be stored into `m_destroy_callback`. This lambda function will first call the old callback, then the new one. This way, `std::vector` is avoided. However, this implementation is more complex, thus less readable, with not much perf to gain.~~ --------- Co-authored-by: Roy Shi <royshi@meta.com>
2024-04-24[lldb][nfc] Move broadcaster class strings away from ConstString (#89690)Alex Langford1-1/+1
These are hardcoded strings that are already present in the data section of the binary, no need to immediately place them in the ConstString StringPools. Lots of code still calls `GetBroadcasterClass` and places the return value into a ConstString. Changing that would be a good follow-up. Additionally, calls to these functions are still wrapped in ConstStrings at the SBAPI layer. This is because we must guarantee the lifetime of all strings handed out publicly.
2023-09-14[lldb] Add config and decorator for wide character support in Editline (#66447)Jonas Devlieghere1-0/+3
Add a configuration entry for whether LLDB was configured with wide character support in Editline and use it in a decorator to guard the UTF-8 prompt test.
2023-08-15[lldb] Move deprecation message from implementation to header (NFC)Jonas Devlieghere1-2/+0
Address Alex's post commit review feedback from D158000.
2023-08-15[lldb] Remove {Get,Set}CloseInputOnEOF and deprecate SB equivalent (NFC)Jonas Devlieghere1-4/+3
These functions have been NO-OPs since 2014 (44d937820b451). Remove them and deprecate the corresponding functions in SBDebugger. Differential revision: https://reviews.llvm.org/D158000
2023-08-09[lldb] Sink StreamFile into lldbHostAlex Langford1-1/+1
StreamFile subclasses Stream (from lldbUtility) and is backed by a File (from lldbHost). It does not depend on anything from lldbCore or any of its sibling libraries, so I think it makes sense for this to live in lldbHost instead. Differential Revision: https://reviews.llvm.org/D157460
2023-07-14[lldb][NFCI] Remove unneeded temporary std::string allocations in SBAPIAlex Langford1-3/+3
This uses some friend class trickery to avoid some unneeded temporary std::string allocations. Differential Revision: https://reviews.llvm.org/D155035
2023-05-30[lldb][NFCI] Change type of SBDebugger::m_instance_nameAlex Langford1-6/+9
This doesn't need to be in the ConstString StringPool. There's little benefit to having these be unique, and we don't need fast comparisons on them. Differential Revision: https://reviews.llvm.org/D151524
2023-05-10[lldb] Mark most SBAPI methods involving private types as protected or privateAlex Langford1-36/+36
Many SB classes have public constructors or methods involving types that are private. Some are more obvious (e.g. containing lldb_private in the name) than others (lldb::FooSP is usually std::shared_pointer<lldb_private::Foo>). This commit explicitly does not address FileSP, so I'm leaving that one alone for now. Some of these were for other SB classes to use and should have been made protected/private with a friend class entry added. Some of these were public for some of the swig python helpers to use. I put all of those functions into a class and made them static methods. The relevant SB classes mark that class as a friend so they can access those private/protected members. I've also removed an outdated SBStructuredData test (can you guess which constructor it was using?) and updated the other relevant tests. Differential Revision: https://reviews.llvm.org/D150157
2023-05-02[lldb] Remove unused will_modify argument (NFC)Jonas Devlieghere1-1/+1
Various OptionValue related classes are passing around will_modify but the value is never used. This patch simplifies the interfaces by removing the redundant argument.
2023-04-17[lldb] Change parameter type of StructuredData::ParseJSONAlex Langford1-2/+1
Instead of taking a `const std::string &` we can take an `llvm::StringRef`. The motivation for this change is that many of the callers of `ParseJSON` end up creating a temporary `std::string` from an existing `StringRef` or `const char *` in order to satisfy the API. There's no reason we need to do this. Differential Revision: https://reviews.llvm.org/D148579
2023-03-15Add a Debugger interruption mechanism in conjunction with theJim Ingham1-0/+21
Command Interpreter mechanism. Differential Revision: https://reviews.llvm.org/D145136
2023-03-07Add a new SBDebugger::SetDestroyCallback() APIJeffrey Tan1-0/+9
Adding a new SBDebugger::SetDestroyCallback() API. This API can be used by any client to query for statistics/metrics before exiting debug sessions. Differential Revision: https://reviews.llvm.org/D143520
2023-02-12[lldb] Add the ability to provide a message to a progress event updateJonas Devlieghere1-1/+3
Consider the following example as motivation. Say you have to load symbols for 3 dynamic libraries: `libFoo`, `libBar` and `libBaz`. Currently, there are two ways to report process for this operation: 1. As 3 separate progress instances. In this case you create a progress instance with the message "Loading symbols: libFoo", "Loading symbols: libBar", and "Loading symbols: libBaz" respectively. Each progress event gets a unique ID and therefore cannot be correlated by the consumer. 2. As 1 progress instance with 3 units of work. The title would be "Loading symbols" and you call Progress::Increment for each of the libraries. The 3 progress events share the same ID and can easily be correlated, however, in the current design, there's no way to include the name of the libraries. The second approach is preferred when the amount of work is known in advance, because determinate progress can be reported (i.e. x out of y operations completed). An additional benefit is that the progress consumer can decide to ignore certain progress updates by their ID if they are deemed to noisy, which isn't trivial for the first approach due to the use of different progress IDs. This patch adds the ability to add a message (detail) to a progress event update. For the example described above, progress can now be displayed as shown: [1/3] Loading symbols: libFoo [2/3] Loading symbols: libBar [3/3] Loading symbols: libBaz Differential revision: https://reviews.llvm.org/D143690
2023-02-10[lldb] Add an SB API to get progress events as SBStructuredDataJonas Devlieghere1-0/+15
This is a preparatory patch to add an SB API to get the progress data as SBStructuredData. The advantage of using SBStructuredData is that the dictionary can grow over time with more fields. This approach is identical to the way this is implemented for diagnostic events. Differential revision: https://reviews.llvm.org/D143687
2023-02-09[lldb] Hoist code to create StructuredData into DiagnosticEventData (NFC)Jonas Devlieghere1-10/+5
Hoist the code that creates a StructuredData dictionary from a diagnostic event into the DiagnosticEventData. This addresses Ismail's code review feedback from D143687. Differential revision: https://reviews.llvm.org/D143694
2023-01-13Revert "[lldb] Add Debugger & ScriptedMetadata reference to ↵Med Ismail Bennani1-2/+1
Platform::CreateInstance" This reverts commit 2d53527e9c64c70c24e1abba74fa0a8c8b3392b1.
2023-01-12[lldb] Add Debugger & ScriptedMetadata reference to Platform::CreateInstanceMed Ismail Bennani1-1/+2
This patch is preparatory work for Scripted Platform support and does multiple things: First, it introduces new options for the `platform select` command and `SBPlatform::Create` API, to hold a reference to the debugger object, the name of the python script managing the Scripted Platform and a structured data dictionary that the user can use to pass arbitrary data. Then, it updates the various `Create` and `GetOrCreate` methods for the `Platform` and `PlatformList` classes to pass down the new parameter to the `Platform::CreateInstance` callbacks. Finally, it updates every callback to reflect these changes. Differential Revision: https://reviews.llvm.org/D139249 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-01-10Move from llvm::makeArrayRef to ArrayRef deduction guides - last partserge-sans-paille1-1/+1
This is a follow-up to https://reviews.llvm.org/D140896, split into several parts as it touches a lot of files. Differential Revision: https://reviews.llvm.org/D141298
2022-10-31[lldb] Add diagnosticsJonas Devlieghere1-0/+11
Around this time last year, I said on the mailing list [1] that I wanted to to transform the reproducers into something that resembles a sysdiagnose on Apple platforms: a collection of files containing a variety of information to help diagnose bugs or troubleshoot issues. This patch adds that framework. Based on lessons learned from the reproducers, I've intentionally tried to keep it small and simple. Different parts of LLDB can register callbacks (this is necessary for layering purposes) that will get called when the diagnostics should be generated. [1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html Differential revision: https://reviews.llvm.org/D134991
2022-09-19[lldb] Remove LLDB reproducersJonas Devlieghere1-4/+6
This patch removes the remaining reproducer code. The SBReproducer class remains for ABI stability but is just an empty shell. This completes the removal process outlined on the mailing list [1]. [1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
2022-09-11Add SBDebugger::GetSetting() public APIsJeffrey Tan1-0/+23
This patch adds new SBDebugger::GetSetting() API which enables client to access settings as SBStructedData. Implementation wise, a new ToJSON() virtual function is added to OptionValue class so that each concrete child class can override and provides its own JSON representation. This patch aims to define the APIs and implement a common set of OptionValue child classes, leaving the remaining for future patches. This patch is used later by auto deduce source map from source line breakpoint feature for testing generated source map entries. Differential Revision: https://reviews.llvm.org/D133038
2022-06-24[lldb] Add support for specifying a log handlerJonas Devlieghere1-1/+2
This patch adds a new flag to `log enable`, allowing the user to specify a custom log handler. In addition to the default (stream) handler, this allows using the circular log handler (which logs to a fixed size, in-memory circular buffer) as well as the system log handler (which logs to the operating system log). Differential revision: https://reviews.llvm.org/D128323