[Lldb-commits] [PATCH] D126513: Add -b (--continue-to-breakpoint) option to the "process continue" command

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 26 18:37:03 PDT 2022


jingham created this revision.
jingham added reviewers: JDevlieghere, kastiglione.
Herald added a project: All.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Sometimes you have a complex set of breakpoints, some enabled and some not, but for the next continue you just want to run till you hit some subset of the breakpoints you have set without disturbing the state of other breakpoints.  This patch adds an option for that.  Just say:

(lldb) continue -b 10

That will temporarily disable all the other breakpoints but 10, run till you hit 10, and then stop.

Note, this is just a continue option, not a thread plan, so if you stop for any other reason like a signal, or you interrupt the process, then the state will be restored and you will stop.  We don't force continuing to one of the breakpoints specified.  continue is not stateful, so I think this is what people would expect.

You can also specify a breakpoint name, and the option can be repeated, so:

(lldb) continue -b 10 -b MyBKPTS -b 20

will continue till you hit either breakpoints 10, 20, or any that have the name MyBKTPS.

Continuing to a breakpoint that's disabled is not going to be very satisfying.  I could either temporarily enable the breakpoint, continue to it, then disable it again, or return an error.  In this patch I return an error, since I think you would want to know you are trying to continue to a breakpoint you've disabled.  But I could be persuaded the other behavior is more convenient.

BTW, this is a built-in version of the Python command in:

https://reviews.llvm.org/D125148

I still think that's worthwhile as an example, but the behavior seemed useful enough to be built-in.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126513

Files:
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/Options.td
  lldb/test/API/commands/process/continue_to_bkpt/Makefile
  lldb/test/API/commands/process/continue_to_bkpt/TestContinueToBkpts.py
  lldb/test/API/commands/process/continue_to_bkpt/main.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126513.432433.patch
Type: text/x-patch
Size: 10960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220527/3fda07bc/attachment.bin>


More information about the lldb-commits mailing list