[all-commits] [llvm/llvm-project] 974958: [lldb] Reset breakpoint hit count before new runs

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Mon Sep 19 09:56:34 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 974958749827bc4fb88b67feab4bcd7536f70456
      https://github.com/llvm/llvm-project/commit/974958749827bc4fb88b67feab4bcd7536f70456
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2022-09-19 (Mon, 19 Sep 2022)

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

  Log Message:
  -----------
  [lldb] Reset breakpoint hit count before new runs

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.

Differential Revision: https://reviews.llvm.org/D133858




More information about the All-commits mailing list