[Lldb-commits] [lldb] DRAFT: Add a `breakpoint add` command to fix the option-madness that is `breakpoint set` (PR #156067)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 29 10:28:55 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r origin/main...HEAD lldb/packages/Python/lldbsuite/test/lldbutil.py
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- lldbutil.py 2025-08-29 17:08:18.000000 +0000
+++ lldbutil.py 2025-08-29 17:28:27.144200 +0000
@@ -318,13 +318,16 @@
# ==================================================
# Utility functions for setting breakpoints
# ==================================================
g_use_break_add = True
+
+
def set_use_break_add(use_it):
global g_use_break_add
g_use_break_add = use_it
+
def get_use_break_add():
global g_use_break_add
return g_use_break_add
@@ -421,11 +424,11 @@
if extra_options:
command += " " + extra_options
if get_use_break_add():
- command += f" -- '{symbol}'"
+ command += f" -- '{symbol}'"
break_results = run_break_set_command(test, command)
if num_expected_locations == 1 and sym_exact:
check_breakpoint_result(
@@ -449,11 +452,11 @@
"""Set a breakpoint by selector. Common options are the same as run_break_set_by_file_and_line."""
if get_use_break_add():
command = f"breakpoint add name --match-style selector '{selector}'"
else:
- command = 'breakpoint set -S "%s"' % (selector)
+ command = 'breakpoint set -S "%s"' % (selector)
if module_name:
command += ' --shlib "%s"' % (module_name)
if extra_options:
``````````
</details>
https://github.com/llvm/llvm-project/pull/156067
More information about the lldb-commits
mailing list