aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python
AgeCommit message (Collapse)AuthorFilesLines
35 hours[lldb] add cross platform test commands in Makefile.rules (#180224)Charles Zablit1-0/+23
This patch adds cross platform (Darwin, Linux, Windows) commands in `Makefile.rules` which is used to build lldb test targets. This maps POSIX commands like `mkdir -p` to their Windows equivalent, which allows to create cross platform `Makefile` for lldb's test targets. This is currently not needed by any test but might become useful later as we are working on enabling more lldb Windows tests. This was originally done in the `swiftlang/llvm-project` fork (https://github.com/swiftlang/llvm-project/pull/12127)
4 days[lldb-dap] Add validation for RunInTerminal client capability (#180213)Ebuka Ezike2-4/+19
Check if the client supports RunInTerminal before attempting to run in the preferred terminal. One less unknown reason for failed to launch
5 days[lldb-dap] Allow evaluate requests without a frame context (#179667)Ebuka Ezike1-5/+11
EvaluateRequests handler now uses the target's context if no valid frameId is provided, enabling evaluation of global variables without requiring a valid stack frame. In repl mode it now uses the last `successful` variable or command expression, if the provided user's expression is empty. Try to evaluate the expression if the evaluation context is `Unknown`
5 days[lldb-dap] Fix flaky TestDAP_stopped_events.py (#179689)Ebuka Ezike1-1/+1
We are waiting for both stopped event at once. We may not get both events within the (0.25 seconds) time interval to fetch more events. Retry with the `DEFAULT TIMEOUT` if we got one of the event. Increase the `EVENT_QUIET_PERIOD`'s value for ASAN mode Fixes #179648
6 days[lldb][test] Add SBExpressionOptions parameter to expect_expr (#177920)Michael Buch1-5/+9
Allows API tests to pass `SBExpressionOptions` when testing a successful expression evaluation with `expect_expr`. Currently one would have to use `SBFrame::EvaluateExpression` or pass the option as an argument to the raw command (via `expect()` or `HandleCommand()`). Chose not to do the `SetIgnoreBreakpoints`/`SetAutoApplyFixIts` with the assumption that most expression evaluation tests don't actually need to care about these. If the options are passed explicitly, lets use them as-is. Otherwise default to the old options. First usage of this new parameter would be in https://github.com/llvm/llvm-project/pull/177926
6 days[lldb]Send statistics in initialized event (#178978)GeorgeHuyubo1-0/+2
Re-attemp landing of old commit: https://github.com/llvm/llvm-project/commit/7fe3586cda5b683766ec6b6d5ca2d98c2baaf162 Co-authored-by: George Hu <georgehuyubo@gmail.com>
7 days[lldb-dap] Fix DAP_launch_io.py Test (#179295)Ebuka Ezike1-0/+3
DAP_launch_io sends a continue request for a nonstopped process. Use verify_process_exited instead.
7 days[lldb-dap] Migrating 'stopped' event to structured types. (#176273)John Harrison2-4/+11
Updates the 'stopped' event to use structure types. Additionally, I adjusted the description to include the full `GetStopDescription` that can have more details.
11 daysRestore unintentionally changed filesIgor Kudrin1-1/+1
This restores files that were unintentionally added to commit 21a74f527839b5b8dd882e62a25093d980c79078, 'Revert "[lldb] Add FP conversion instructions to IR interpreter (#175292)"'
11 dayslldb-dap: Stop using replicated variable ids (#124232)Anthony Eid1-2/+30
Closes #119784 Probably closes #147105 as well, but I couldn't test due to #156473: This PR fixes two bugs: 1. It generates unique variable reference IDs per suspended debuggee state. 2. It stores all created variables in a stopped state instead of dropping variables in unselected scopes. So it can properly handle all scope/variable requests It does this by storing all variables in their respective scopes and using that mapping in request handlers that relied on the old mapping. It dynamically creates new variable/scope IDs instead of resetting IDs whenever a new scope is created. I also removed some unused code as well. --------- Co-authored-by: Med Ismail Bennani <ismail@bennani.ma> Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com> Co-authored-by: Ebuka Ezike <yerimyah1@gmail.com>
11 daysRevert "[lldb] Add FP conversion instructions to IR interpreter (#175292)"Igor Kudrin1-1/+1
This reverts commit c2082a65b7fc8e7587ed07170e250820d6bbda1d.
13 days[lldb] Fix UbSan decorator (#177964)Ebuka Ezike3-28/+25
the ubsan decorator previously assumes the platform is macOS. macOS has an extra underscore in symbols names match two or more. uses the llvm-nm that is built instead of the system's nm.
13 days[lldb-dap] Adding more details to 'exceptionInfo'. (#176465)John Harrison1-22/+30
In the exceptionInfo request I've added additional information for crash data, instrumentation data and more detailed exception data. For example, when UBSan is enabled, you now see additional information in the exception stack trace about the detected issue: <img width="1728" height="538" alt="Screenshot 2026-01-15 at 3 05 08 PM" src="https://github.com/user-attachments/assets/b761af2c-90ac-4eb7-9926-3ab133f1b753" /> I included a new test for stopping at `lldb::eStopReasonInstrumentation` and ensuring we have additional information reported. --------- Co-authored-by: Ebuka Ezike <yerimyah1@gmail.com> Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
13 days[lldb-dap] Improve test performance by removing negative assertions. (#178041)John Harrison3-121/+177
Investigating some of the biggest slow downs during tests, the biggest offender is 'wait_for_stopped' requiring a negative assertion around the 'stopped' event. It currently waits for a negative predicate to fail before continuing. This means it must wait for the full DEFAULT_TIMEOUT (50s) before the test is allowed to continue. To mitigate this, I added a new `collect_events` helper that will wait for the given event to occur with the DEFAULT_TIMEOUT, then wait for a quiet period (0.25s) before returning. This greatly reduces the amount of idle waiting during tests. Additionally, looking a the performance of individual test files, `TestDAP_launch` is the slowest overall test. No individual test is that slow, but the fact it has so many tests in the same file results in the test harness waiting for that one file to finish. To mitigate that, I split `TestDAP_launch` into individual test files that run in parallel, reducing the runtime locally from over 2mins to ~5s.
2026-01-26[lldb-dap] Fix assertion on the recv thread. (#177977)Ebuka Ezike1-1/+1
threading.current_thread is a function
2026-01-23Revert "[lldb] Fix setting CanJIT if memory cannot be allocated (#176099)"Augusto Noronha2-15/+2
This reverts commit b5d8fc553d8e03f4d325458d29ac2c9e46a464e3.
2026-01-23[lldb] Fix setting CanJIT if memory cannot be allocated (#176099)Igor Kudrin2-2/+15
When a server is unable to allocate memory for the `_M` packet, it may respond with an error code. In this case, `GDBRemoteCommunicationClient::AllocateMemory()` sets `m_supports_alloc_dealloc_memory` to `eLazyBoolYes`; `eLazyBoolNo` is only used if the server cannot handle the packet at all. Before this patch, `ProcessGDBRemote::DoAllocateMemory()` checked this flag and returned `LLDB_INVALID_ADDRESS` without setting an error, which caused `Process::CanJIT()` to set `m_can_jit = eCanJITYes`, resulting in `IRMemoryMap::FindSpace()` attempting to allocate memory in the inferior process and failing. With the patch, `ProcessGDBRemote::DoAllocateMemory()` returns an error and `m_can_jit` is set to `eCanJITNo`. Example debug session: ``` (lldb) platform connect... (lldb) file test (lldb) br set... (lldb) run Process 100 launched:... Process 100 stopped * thread #1,... (lldb) expr $x0 error: Couldn't allocate space for materialized struct: Couldn't malloc: address space is full error: errored out in virtual lldb_private::LLVMUserExpression::DoExecute, couldn't PrepareToExecuteJITExpression ```
2026-01-23[lldb] Improve filecheck() by replacing assertTrue with assertEqual (#177212)Dave Lee1-2/+2
2026-01-20[lldb] Fix the 'skipUnlessUndefinedBehaviorSanitizer' decorator. (#176463)John Harrison1-20/+23
This decorator is trying to reference the file that is already deleted by the time the `nm` call is made. Fix this by correcting how `_compiler_supports` the `output_file` argument.
2026-01-19Revert "[lldb] add a marker before hidden frames (#167550)" (#176747)Charles Zablit1-29/+0
2026-01-19[lldb-dap] Fix Completions Request crash (#176211)Ebuka Ezike1-1/+6
lldb-dap currently crashes when the first character is non ascii. This is because we assume that the request column is ascii based instead of UTF16 code units, and end up in the middle of a character code point. causing an assertion since we cannot not send invalid UTF-8 values. This also handles the case in multilines and the column is outside the range of the text. Move completion description to the `CompletionItem.detail` property.
2026-01-19[lldb] add a marker before hidden frames (#167550)Charles Zablit1-0/+29
**This patch adds a marker to make hidden frames more explicit.** --- Hidden frames can be confusing for some users, who see that the indexes of the frames in a backtrace are not contiguous. This patch aims to lessen the confusion by adding a delimiter for the first and last non hidden frame, i.e the boundaries. IDE's like Xcode and VSCode represent those in the UI by having the hidden frames either greyed out or collapsed. It's not possible to do this in the CLI, therefore, this patch makes use of 2 unicode characters to mark the beginning and end of the hidden frames range. This patch depends on: - https://github.com/llvm/llvm-project/pull/168603 # Examples In the example below, frame `#2` to `#7` are is hidden, and therefore, frame `#1` is the first non hidden frame of the range while frame `#8` is the last non hidden frame: <img width="488" height="112" alt="Screenshot 2025-11-18 at 18 41 11" src="https://github.com/user-attachments/assets/a21431da-9729-4cf0-a6bc-024aa306fc45" /> If the selected frame is one of the 2 boundary frames, we replace the delimiter character with the select character (`*`). <img width="487" height="111" alt="Screenshot 2025-11-18 at 18 41 03" src="https://github.com/user-attachments/assets/5616fa81-6db6-457d-9d1e-bbe46e710c26" /> <img width="488" height="111" alt="Screenshot 2025-11-18 at 18 40 55" src="https://github.com/user-attachments/assets/93dfa6cf-0956-4718-b31c-f965ec72b56d" />
2026-01-15[lldb-dap] Move targetId and debuggerId into a session property (#175930)Ebuka Ezike1-6/+3
This makes it clear the fields required for attaching to an existing debug session. It also makes it easier to check mutually exclusive fields required to attach.
2026-01-13[lldb-dap] Add testcases for stdio redirection on different console types. ↵Ebuka Ezike2-4/+24
(#175048) There are some bugs when launching in terminal with args and stdio redirection. - lldb-dap `--stdio` args is passed to the debuggee (should we change this to use `--` to separate debuggee args from lldb-dap args, similar to how we handle the `--client` args? ). #### It also changes the behaviour of stdio redirection. If a redirection is not specified, it uses to lldb default value. e.g. ```jsonc "stdio": ["./stdin"]` // now becomes "stdio", ["./stdio", "./default_stdout", "./default_stderr"] // instead of "stdio", ["./stdin", "./stdin", "./stdin"] // took quite some time to figure out where my output is going to. ``` Fixes [#174445](https://github.com/llvm/llvm-project/issues/174445) Other bug I noticed but should be in a different PR. - debuggee args that contains newline are not properly escaped when sent to the terminal.
2026-01-12[NFCI][lldb][test][asm] Enable AT&T syntax explicitly (#172358)Raul Tambre1-0/+15
Implementation files using the Intel syntax typically explicitly specify it. Do the same for the few files using AT&T syntax. This enables building LLVM with `-mllvm -x86-asm-syntax=intel` in one's Clang config files (i.e. a global preference for Intel syntax). Unreverts: 14c69497b31038b37c273417f43bd2cfe169c86f
2026-01-08[lldb] Fix typed commands not shown on the screen (#174216)Ebuka Ezike1-0/+1
The cause is that in `python3.14`, `fcntl.ioctl` now throws a buffer overflow error when the buffer is too small or too large (see https://github.com/python/cpython/pull/132919). This caused the Python interpreter to fail terminal detection and not properly echo user commands back to the screen. Fix by dropping the custom terminal size check entirely and using the built-in `sys.stdin.isatty()` instead. Fixes #173302
2026-01-08[lldb-dap][windows] fix lldb-dap executable name in test (#175014)Charles Zablit1-1/+3
This patch fixes an incorrect name of the `lldb-dap` process on Windows by appending `.exe` to the name. This is a prelude to https://github.com/llvm/llvm-project/pull/174635.
2026-01-07[lldb] Add zlib to version -v output (#174753)David Spickett1-0/+4
I know this is required for at least one feature, because TestSectionAPI.py has failures if zlib isn't enabled. So I think it's useful for users to be able to check. Now that it's in the config, I have also used it to make a test annotation so we don't get the failure in TestSectionAPI.py when zlib is disabled. Which for future reference was: Traceback (most recent call last): File "/home/davspi01/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 452, in wrapper return func(self, *args, **kwargs) File "/home/davspi01/llvm-project/lldb/test/API/python_api/section/TestSectionAPI.py", line 67, in test_compressed_section_data self.assertEqual(section_data, [0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90]) AssertionError: Lists differ: [] != [32, 48, 64, 80, 96, 112, 128, 144] As it failed to decode the compressed section.
2026-01-06[lldb-dap] Add skipIfWindowsWithoutConPTY decorator for clearer test ↵Ebuka Ezike1-0/+8
requirements (#174509) Replace version matching with the new decorator to prevent typos, and make to it clear why we skipped the test.
2026-01-02[lldb-dap][NFC] change the dap log file extension (#173994)Ebuka Ezike1-1/+1
2025-12-24[lldb] Add Python 3.8 compatibility for lldbtest.py (#173392)Ebuka Ezike1-0/+3
follow up from 9892870687e0af00e798474aa5cecfd4647071e1 as we recently added type hints to this file
2025-12-23[lldb-dap] refactor monitor thread in tests (#172879)Charles Zablit1-5/+26
This patch fixes a timeout in the monitor thread of the `test_by_name_waitFor` test. Currently, if `self.attach` fails, the `spawn_thread` will never finish and the test will eventually timeout after the 15mins timeout. We now ensure that we always join the thread at the end of the test. Additionally, this change also uses of the `spawnSubprocess` method to create the process. This should ensure the process is always properly cleaned up after an exception occurs.
2025-12-22[lldb-dap] Adjusting the initialize/launch flow to better match the spec. ↵John Harrison2-29/+41
(#171549) In https://github.com/llvm/llvm-project/pull/170523 it was pointed out that the spec does specifically specify that launch/attach should not respond until configurationDone is handled. This means we do need to support async request handlers. To better align with the spec, I've added a new `lldb_dap::AsyncRequestHandler`. This is an additional handler type that allows us to respond at a later point. Additionally, I refactored `launch` and `attach` to only respond once the `configurationDone` is complete, specifically during the `PostRun` operation of the `configurationDone` handler. I merged some of the common behavior between `RequestHandler` and `AsyncRequestHandler` into their common `BaseRequestHandler`. The flow should now be: ``` <-> initialize request / response --> launch/attach request <-- event initialized ... optionally ... <-> setBreakpoints request / response <-> setFunctionBreakpoints request / response <-> setExceptionBreakpoints request / response <-> setInstructionBreakpoints request / response ... finally ... <-> configurationDone request / response <-- launch/attach response ``` --------- Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-12-22[lldb-dap][test] Add Python 3.8 compatibility for test suite (#173264)Ebuka Ezike2-1/+11
Python 3.8 does not support subscriptable built-in types (dict[int], list[str], etc.) without importing annotations from __future__. This change adds `annotations` imports and handles missing API functions.
2025-12-18[lldb][windows] refactor the version check in @skipIfWindows (#172838)Charles Zablit2-28/+63
This patch refactors the way we check for the windows version in the `@skipIfWindows` decorator. The new logic reuses the `expectedCompilerVersion` method logic for the parsing and comparison of the version.
2025-12-18[lldb][windows] add Windows Virtual Console support (#168729)Charles Zablit1-2/+28
2025-12-17Revert "Make result variables obey their dynamic values in subsequent ↵Dave Lee1-3/+1
expressions (#168611)" (#172780) [Green Dragon's lldb incremental tests (x86_64)](https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/) are failing beginning with https://github.com/llvm/llvm-project/pull/168611. This commit reverts that change. If the job continues to fail after committing this revert, then I will recommit the original. rdar://166741668 This reverts commit 6344e3aa8106dfdfb30cac36c8ca02bc4c52ce24.
2025-12-18[lldb/test] Fix libcxx configuration handling for remote platforms (#172761)Med Ismail Bennani1-1/+11
When using --platform remote-* options, explicitly clear the libcxx configuration variables instead of just warning and continuing with potentially set values. This prevents the test suite from attempting to use custom libcxx paths on remote platforms where they're not applicable. Also initialize libcxx variables to None when not specified, ensuring a clean state regardless of how the arguments are parsed. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-12-15Partially revert "[NFCI][lldb][test][asm] Enable AT&T syntax explicitly ↵Raul Tambre1-7/+0
(#166770)" (#172233) Flag changes reverted as those require the X86 target to be enabled. Don't have time to test fixes as I need to go to sleep so will revert for now. Reverts: 423919d31f4b55f22b09cd5066534f7c91e71d4b
2025-12-14[NFCI][lldb][test][asm] Enable AT&T syntax explicitly (#166770)Raul Tambre1-0/+7
Implementation files using the Intel syntax typically explicitly specify it. Do the same for the few files using AT&T syntax. This enables building LLVM with `-mllvm -x86-asm-syntax=intel` in one's Clang config files (i.e. a global preference for Intel syntax).
2025-12-11Make result variables obey their dynamic values in subsequent expressions ↵jimingham1-1/+3
(#168611) When you run an expression and the result has a dynamic type that is different from the expression's static result type, we print the result variable using the dynamic type, but at present when you use the result variable in an expression later on, we only give you access to the static type. For instance: ``` (lldb) expr MakeADerivedReportABase() (Derived *) $0 = 0x00000001007e93e0 (lldb) expr $0->method_from_derived() ^ error: no member named 'method_from_derived' in 'Base' (lldb) ``` The static return type of that function is `Base *`, but we printed that the result was a `Derived *` and then only used the `Base *` part of it in subsequent expressions. That's not very helpful, and forces you to guess and then cast the result types to their dynamic type in order to be able to access the full type you were returned, which is inconvenient. This patch makes lldb retain the dynamic type of the result variable (and ditto for persistent result variables). It also adds more testing of expression result variables with various types of dynamic values, to ensure we can access both the ivars and methods of the type we print the result as.
2025-12-10[lldb-dap] Fix running dap_server.py directly for debugging tests. (#167754)John Harrison1-255/+323
This adjusts the behavior of running dap_server.py directly to better support the current state of development. A few parts of the 'main' body were stale and not functional. These improvements include: * Instead of the custom tracefile / replay file parsing logic, I adjusted the replay helper to handle parsing lldb-dap log files created with the `LLDBDAP_LOG` env variable, allowing you to more easily run a failing test like: `python3 lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py --adapter lldb-dap -r lldb-test-build.noindex/tools/lldb-dap/console/TestDAP_console.test_custom_escape_prefix/dap.txt` * Migrated argument parsing to `argparse`, that is in all verisons of py3+ and has a few improvements over `optparse`. * Corrected the existing arguments and updated `run_vscode` > `run_adapter`. You can use this for simple debugging like: `xcrun python3 lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py --adapter=lldb-dap --adapter-arg='--pre-init-command' --adapter-arg 'help' --program a.out --init-command 'help'`
2025-12-10[lldb] convert jit-loader_rtdyld_elf.test to an API test (#170333)Charles Zablit1-0/+13
This patch converts the `jit-loader_rtdyld_elf.test` test from a Shell test to an API test. This test is timing out in CI on Windows and the hang cannot be reproduced at desk. Converting it to an API test would allow us to instrument it better in order to trace the failure.
2025-12-10[lldb-dap] Increase DAP default timeout (#170890)Ebuka Ezike2-4/+5
DAP tests easily timeout when the computer is under-load. This is easily noticeable if you run the test in a loop a compile llvm. or running the test on slower CI/machines. This affects mostly the `DAP_launch`, `DAP_attach`, `DAP_restart_console` and occasionally `DAP_output` tests. Would lead in the direction of enabling some of the test on windows. ``` File "/Volumes/workspace/Dev/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 1140, in request_launch return self._send_recv(command_dict) File "/Volumes/workspace/Dev/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 548, in _send_recv raise ValueError(f"no response for {request!r}") ValueError: no response for {'command': 'launch', 'type': 'request', 'arguments': {'program': '/Volumes/workspace/Dev/llvm-build/release/lldb-test-build.noindex/tools/lldb-dap/restart/TestDAP_restart_console.test_basic_functionality/a.out', 'initCommands': ['settings clear --all', 'settings set symbols.enable-external-lookup false', 'settings set target.inherit-tcc true', 'settings set target.disable-aslr false', 'settings set target.detach-on-error false', 'settings set target.auto-apply-fixits false', 'settings set plugin.process.gdb-remote.packet-timeout 60', 'settings set symbols.clang-modules-cache-path "/Volumes/workspace/Dev/llvm-build/release/lldb-test-build.noindex/module-cache-lldb"', 'settings set use-color false', 'settings set show-statusline false'], 'console': 'integratedTerminal', 'disableASLR': False, 'enableAutoVariableSummaries': False, 'enableSyntheticChildDebugging': False, 'displayExtendedBacktrace': False}, 'seq': 2} Config=arm64-/Volumes/workspace/Dev/llvm-build/release/bin/clang ---------------------------------------------------------------------- Ran 2 tests in 28.579s ``` Increase the DEFAULT_TIMEOUT from 10 to 50
2025-12-04Add a `breakpoint add` command to fix the option-madness that is `breakpoint ↵jimingham1-10/+51
set` (#156067) Someone came up with a clever idea for a new breakpoint type, but we couldn't figure out how to add it in an ergonomic way because `breakpoint set` has used up all the short-option characters. And even if they did find a way to add it, the help for `break set` is so confusing - because of the way it is implemented - that very few people would detect the addition. The basic problem is that `break set` distinguishes amongst the fundamental breakpoint types it offers by which "required option" you provide. If you pass a `-a` you are setting an address breakpoint, if `-n`, `-F`, etc. a symbol name based breakpoint. And so forth. That is however pretty hard to discern from the option grouping printing from `help break set`. `break set` also suffers from the problem that it uses common options in different ways depending on which "required" option is present, which makes documenting the various behaviors difficult. And as we run out of single letters it makes extending it difficult to impossible. This PR fixes that situation by adding a new command for adding breakpoints - `break add`. The new command specifies the "breakpoint types" as subcommands of `break add` rather than distinguishing them by their being one of the "required" options the way `break set` does. That both makes it much clearer what the breakpoint types actually are, and means that the option set can be dedicated to that particular breakpoint type, and so the help for each is less cluttered, and can be documented properly for each usage. Instead of trying to parse the meaning of: ``` (lldb) help break set Sets a breakpoint or set of breakpoints in the executable. Syntax: breakpoint set <cmd-options> Command Options Usage: breakpoint set [-DHd] -l <linenum> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-u <column>] [-f <filename>] [-m <boolean>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-DHd] -a <address-expression> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-N <breakpoint-name>] [-s <shlib-name>] breakpoint set [-DHd] -n <function-name> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-f <filename>] [-L <source-language>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-DHd] -F <fullname> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-f <filename>] [-L <source-language>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-DHd] -S <selector> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-f <filename>] [-L <source-language>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-DHd] -M <method> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-f <filename>] [-L <source-language>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-DHd] -r <regular-expression> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-f <filename>] [-L <source-language>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-DHd] -b <function-name> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-f <filename>] [-L <source-language>] [-s <shlib-name>] [-K <boolean>] breakpoint set [-ADHd] -p <regular-expression> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-N <breakpoint-name>] [-f <filename>] [-m <boolean>] [-s <shlib-name>] [-X <function-name>] breakpoint set [-DHd] -E <source-language> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-N <breakpoint-name>] [-h <boolean>] [-w <boolean>] breakpoint set [-DHd] -P <python-class> [-k <none>] [-v <none>] [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-N <breakpoint-name>] [-f <filename>] [-s <shlib-name>] breakpoint set [-DHd] -y <linespec> [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-R <address>] [-N <breakpoint-name>] [-m <boolean>] [-s <shlib-name>] [-K <boolean>] ``` We instead offer: ``` (lldb) help break add Commands to add breakpoints of various types Syntax: breakpoint add Access the breakpoint search kernels built into lldb. Along with specifying the search kernel, each breakpoint add operation can specify a common set of "reaction" options for each breakpoint. The reaction options can also be modified after breakpoint creation using the "breakpoint modify" command. The following subcommands are supported: address -- Add breakpoints by raw address exception -- Add breakpoints on language exceptions. If no language is specified, break on exceptions for all supported languages file -- Add breakpoints on lines in specified source files name -- Add breakpoints matching function or symbol names pattern -- Add breakpoints matching patterns in the source text Expects 'raw' input (see 'help raw-input'.) scripted -- Add breakpoints using a scripted breakpoint resolver. For more help on any particular subcommand, type 'help <command> <subcommand>'. ``` The individual subcommand helps are also easier to read. They are still a little too verbose because they all repeat the options for the `reactions`. A general fix for our help system would be when a command incorporates an OptionGroup whole into the command options, help would show the option group name - which you could separately look up. But even without that: ``` (lldb) help br a a Add breakpoints by raw address Syntax: breakpoint add address <cmd-options> <address> [<address> [...]] Command Options Usage: breakpoint add address [-DHde] [-G <boolean>] [-C <command>] [-c <expr>] [-Y <source-language>] [-i <count>] [-o <boolean>] [-q <queue-name>] [-t <thread-id>] [-x <thread-index>] [-T <thread-name>] [-N <breakpoint-name>] [-s <shlib-name>] <address> [<address> [...]] -C <command> ( --command <command> ) A command to run when the breakpoint is hit, can be provided more than once, the commands will be run in left-to-right order. -D ( --dummy-breakpoints ) Act on Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets. -G <boolean> ( --auto-continue <boolean> ) The breakpoint will auto-continue after running its commands. -H ( --hardware ) Require the breakpoint to use hardware breakpoints. -N <breakpoint-name> ( --breakpoint-name <breakpoint-name> ) Adds this name to the list of names for this breakpoint. Can be specified more than once. -T <thread-name> ( --thread-name <thread-name> ) The breakpoint stops only for the thread whose thread name matches this argument. -Y <source-language> ( --condition-language <source-language> ) Specifies the Language to use when executing the breakpoint's condition expression. -c <expr> ( --condition <expr> ) The breakpoint stops only if this condition expression evaluates to true. -d ( --disable ) Disable the breakpoint. -e ( --enable ) Enable the breakpoint. -i <count> ( --ignore-count <count> ) Set the number of times this breakpoint is skipped before stopping. -o <boolean> ( --one-shot <boolean> ) The breakpoint is deleted the first time it stop causes a stop. -q <queue-name> ( --queue-name <queue-name> ) The breakpoint stops only for threads in the queue whose name is given by this argument. -s <shlib-name> ( --shlib <shlib-name> ) Set the breakpoint at an address relative to sections in this shared library. -t <thread-id> ( --thread-id <thread-id> ) The breakpoint stops only for the thread whose TID matches this argument. The token 'current' resolves to the current thread's ID. -x <thread-index> ( --thread-index <thread-index> ) The breakpoint stops only for the thread whose index matches this argument. This command takes options and free-form arguments. If your arguments resemble option specifiers (i.e., they start with a - or --), you must use ' -- ' between the end of the command options and the beginning of the arguments. ``` is pretty readable.
2025-12-03[lldb-dap] start all sent protocol message from number one. (#170378)Ebuka Ezike1-1/+1
This aligns with the DAP [specification](https://microsoft.github.io/debug-adapter-protocol//specification.html#Base_Protocol_ProtocolMessage) Force it to be an error in test cases.
2025-12-01[lldb] Add type hints for gdbclientutils.py when base class returns ↵Daniel Sanders1-37/+37
Literal[T] (#170182) Pyright automatically deduces these functions to return `Literal["foo"]` since the implementation returns "foo". This causes any overload that returns a different literal or a string to report that they're overloaded in an incompatible way. By correctly annotating them as returning str, the overloads can return different strings without this error I was encountering these a lot while writing tests for my downstream target
2025-11-28[lldb][dotest] use unused variable (#169903)Charles Zablit1-5/+1
2025-11-28[lldb-dap] Add data breakpoints for bytes (#167237)Sergei Druzhkov2-6/+9
This patch adds support for `dataBreakpointInfoBytes` capability from DAP. You can test this feature in VSCode (`Add data breakpoint at address` button in breakpoints tab).
2025-11-26[lldb] [test-suite] fix typo in variable in darwin builder (#169254)n2h91-1/+1
While taking a look at the code of lldb test-suite packages, I have noticed that in `get_triple_str` in `darwin.py` env is added inside a `components` list, which is probably supposed to be `component` (defined on the line 61). Signed-off-by: Nikita B <n2h9z4@gmail.com>