Skip to content

Commit 55e68a0

Browse files
Merge pull request #10479 from felipepiovezan/felipe/reland_threadcretiondeletion_62
Reland "[lldb] Clear thread-creation breakpoints in ProcessGDBRemote::Clear (llvm#134397)"
2 parents 358b81f + a206a11 commit 55e68a0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -2486,9 +2486,18 @@ Status ProcessGDBRemote::DoDestroy() {
24862486

24872487
StopAsyncThread();
24882488
KillDebugserverProcess();
2489+
RemoveNewThreadBreakpoints();
24892490
return Status();
24902491
}
24912492

2493+
void ProcessGDBRemote::RemoveNewThreadBreakpoints() {
2494+
if (m_thread_create_bp_sp) {
2495+
if (TargetSP target_sp = m_target_wp.lock())
2496+
target_sp->RemoveBreakpointByID(m_thread_create_bp_sp->GetID());
2497+
m_thread_create_bp_sp.reset();
2498+
}
2499+
}
2500+
24922501
void ProcessGDBRemote::SetLastStopPacket(
24932502
const StringExtractorGDBRemote &response) {
24942503
const bool did_exec =
@@ -3315,9 +3324,6 @@ Status ProcessGDBRemote::DisableWatchpoint(WatchpointSP wp_sp, bool notify) {
33153324
void ProcessGDBRemote::Clear() {
33163325
m_thread_list_real.Clear();
33173326
m_thread_list.Clear();
3318-
if (m_thread_create_bp_sp)
3319-
if (TargetSP target_sp = m_target_wp.lock())
3320-
target_sp->RemoveBreakpointByID(m_thread_create_bp_sp->GetID());
33213327
}
33223328

33233329
Status ProcessGDBRemote::DoSignal(int signo) {

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

+3
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@ class ProcessGDBRemote : public Process,
434434
lldb::user_id_t break_id,
435435
lldb::user_id_t break_loc_id);
436436

437+
/// Remove the breakpoints associated with thread creation from the Target.
438+
void RemoveNewThreadBreakpoints();
439+
437440
// ContinueDelegate interface
438441
void HandleAsyncStdout(llvm::StringRef out) override;
439442
void HandleAsyncMisc(llvm::StringRef data) override;

0 commit comments

Comments
 (0)