[Lldb-commits] [PATCH] D133858: [lldb] Reset breakpoint hit count before new runs

Felipe de Azevedo Piovezan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 14 06:40:44 PDT 2022


fdeazeve created this revision.
Herald added a project: All.
fdeazeve requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

A common debugging pattern is to set a breakpoint that only stops after
a number of hits is recorded. The current implementation never resets
the hit count of breakpoints; as such, if a user re-`run`s their
program, the debugger will never stop on such a breakpoint again.

This behavior is arguably undesirable, as it renders such breakpoints
ineffective on all but the first run. This commit changes the
implementation of the `Will{Launch, Attach}` methods so that they reset
the _target's_ breakpoint hitcounts.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133858

Files:
  lldb/include/lldb/Breakpoint/Breakpoint.h
  lldb/include/lldb/Breakpoint/BreakpointLocation.h
  lldb/include/lldb/Target/Process.h
  lldb/source/Breakpoint/Breakpoint.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Target/Process.cpp
  lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
  lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
  lldb/test/API/functionalities/breakpoint/breakpoint_reset_upon_run/Makefile
  lldb/test/API/functionalities/breakpoint/breakpoint_reset_upon_run/TestBreakpointResetUponRun.py
  lldb/test/API/functionalities/breakpoint/breakpoint_reset_upon_run/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133858.460067.patch
Type: text/x-patch
Size: 14099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220914/8faf835c/attachment.bin>


More information about the lldb-commits mailing list