Skip to content

[lldb] Define breakpoint location "." to mean the location(s) at which the current thread is stopped (#194272)#12855

Open
kastiglione wants to merge 1 commit intostable/21.xfrom
dl/lldb-Define-breakpoint-location-.-to-mean-the-location-s-at-which-the-current-thread-is-stopped-194272
Open

[lldb] Define breakpoint location "." to mean the location(s) at which the current thread is stopped (#194272)#12855
kastiglione wants to merge 1 commit intostable/21.xfrom
dl/lldb-Define-breakpoint-location-.-to-mean-the-location-s-at-which-the-current-thread-is-stopped-194272

Conversation

@kastiglione
Copy link
Copy Markdown

Adds . as a new breakpt-id syntax. Users can specify . to mean the breakpoint
location(s) that caused the current thread to stop.

I selected . to mean the current breakpoint locations for two reasons. In a shells,
period means current directory. In prose, a period is a stop.

My workflow often starts with multiple breakpoint locations, such as with regex
breakpoints, or basename breakpoints for overloaded/overridden names. As locations are
hit, I realize which locations are no longer needed. This new syntax makes it quick and
easy to disable the currently stopped location(s).

Another use case for this is to quickly repeat commands for the current location:

break com add -o 'p someVar' .

Usage example:

'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: ... main`main at main.c:2:3
   1    int main() {
-> 2      return 0;
   3    }
Target 0: (main) stopped.  (lldb) breakpoint disable .  1 breakpoints disabled.  (lldb)
breakpoint list Current breakpoints: 1: file = 'main.c', line = 2, exact_match = 0,
locations = 1
  1.1: where = main`main + 12 at main.c:2:3, address = ..., hit count = 1  Options:
  disabled

rdar://73047170

Assisted-by: claude
(cherry picked from commit 749af7f)

…h the current thread is stopped (llvm#194272)

Adds `.` as a new `breakpt-id` syntax. Users can specify `.` to mean the breakpoint
location(s) that caused the current thread to stop.

I selected `.` to mean the current breakpoint locations for two reasons. In a shells,
period means <ins>current</ins> directory. In prose, a period is a <ins>stop</ins>.

My workflow often starts with multiple breakpoint locations, such as with regex
breakpoints, or basename breakpoints for overloaded/overridden names. As locations are
hit, I realize which locations are no longer needed. This new syntax makes it quick and
easy to disable the currently stopped location(s).

Another use case for this is to quickly repeat commands for the current location:

``` break com add -o 'p someVar' .  ```

Usage example:

``` (lldb) b main.c:2 Process 47071 stopped * thread #1, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: ... main`main at main.c:2:3
   1    int main() {
-> 2      return 0;
   3    }
Target 0: (main) stopped.  (lldb) breakpoint disable .  1 breakpoints disabled.  (lldb)
breakpoint list Current breakpoints: 1: file = 'main.c', line = 2, exact_match = 0,
locations = 1
  1.1: where = main`main + 12 at main.c:2:3, address = ..., hit count = 1  Options:
  disabled
```

rdar://73047170

Assisted-by: claude
(cherry picked from commit 749af7f)
@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test

@kastiglione kastiglione requested a review from a team as a code owner April 28, 2026 21:49
@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

2 similar comments
@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

6 similar comments
@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione
Copy link
Copy Markdown
Author

@swift-ci test windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant