mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 17:28:30 +08:00
[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
This commit is contained in:
@@ -2760,6 +2760,22 @@ ListenerSP ProcessAttachInfo::GetListenerForProcess(Debugger &debugger) {
|
||||
return debugger.GetListener();
|
||||
}
|
||||
|
||||
Status Process::WillLaunch(Module *module) {
|
||||
GetTarget().ResetBreakpointHitCounts();
|
||||
return DoWillLaunch(module);
|
||||
}
|
||||
|
||||
Status Process::WillAttachToProcessWithID(lldb::pid_t pid) {
|
||||
GetTarget().ResetBreakpointHitCounts();
|
||||
return DoWillAttachToProcessWithID(pid);
|
||||
}
|
||||
|
||||
Status Process::WillAttachToProcessWithName(const char *process_name,
|
||||
bool wait_for_launch) {
|
||||
GetTarget().ResetBreakpointHitCounts();
|
||||
return DoWillAttachToProcessWithName(process_name, wait_for_launch);
|
||||
}
|
||||
|
||||
Status Process::Attach(ProcessAttachInfo &attach_info) {
|
||||
m_abi_sp.reset();
|
||||
m_process_input_reader.reset();
|
||||
|
||||
Reference in New Issue
Block a user