Skip to content

Reland "[lldb] Clear thread-creation breakpoints in ProcessGDBRemote::Clear (#134397)" #10479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2486,9 +2486,18 @@ Status ProcessGDBRemote::DoDestroy() {

StopAsyncThread();
KillDebugserverProcess();
RemoveNewThreadBreakpoints();
return Status();
}

void ProcessGDBRemote::RemoveNewThreadBreakpoints() {
if (m_thread_create_bp_sp) {
if (TargetSP target_sp = m_target_wp.lock())
target_sp->RemoveBreakpointByID(m_thread_create_bp_sp->GetID());
m_thread_create_bp_sp.reset();
}
}

void ProcessGDBRemote::SetLastStopPacket(
const StringExtractorGDBRemote &response) {
const bool did_exec =
Expand Down Expand Up @@ -3315,9 +3324,6 @@ Status ProcessGDBRemote::DisableWatchpoint(WatchpointSP wp_sp, bool notify) {
void ProcessGDBRemote::Clear() {
m_thread_list_real.Clear();
m_thread_list.Clear();
if (m_thread_create_bp_sp)
if (TargetSP target_sp = m_target_wp.lock())
target_sp->RemoveBreakpointByID(m_thread_create_bp_sp->GetID());
}

Status ProcessGDBRemote::DoSignal(int signo) {
Expand Down
3 changes: 3 additions & 0 deletions lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ class ProcessGDBRemote : public Process,
lldb::user_id_t break_id,
lldb::user_id_t break_loc_id);

/// Remove the breakpoints associated with thread creation from the Target.
void RemoveNewThreadBreakpoints();

// ContinueDelegate interface
void HandleAsyncStdout(llvm::StringRef out) override;
void HandleAsyncMisc(llvm::StringRef data) override;
Expand Down