This revision was automatically updated to reflect the committed changes.
Closed by commit rG9a1ce35d7e7f: [lldb] [Process/FreeBSD] Set current thread ID
on events (authored by mgorny).
Herald added a project: LLDB.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117103/new/
https://reviews.llvm.org/D117103
Files:
lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
Index: lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
===================================================================
--- lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
+++ lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
@@ -254,6 +254,7 @@
for (const auto &thread : m_threads)
static_cast<NativeThreadFreeBSD &>(*thread).SetStoppedByExec();
+ SetCurrentThreadID(m_threads.front()->GetID());
SetState(StateType::eStateStopped, true);
return;
}
@@ -312,6 +313,7 @@
} else
thread->SetStoppedByBreakpoint();
FixupBreakpointPCAsNeeded(*thread);
+ SetCurrentThreadID(thread->GetID());
}
SetState(StateType::eStateStopped, true);
return;
@@ -333,11 +335,13 @@
if (wp_index != LLDB_INVALID_INDEX32) {
regctx.ClearWatchpointHit(wp_index);
thread->SetStoppedByWatchpoint(wp_index);
+ SetCurrentThreadID(thread->GetID());
SetState(StateType::eStateStopped, true);
break;
}
thread->SetStoppedByTrace();
+ SetCurrentThreadID(thread->GetID());
}
SetState(StateType::eStateStopped, true);
@@ -370,9 +374,10 @@
static_cast<NativeThreadFreeBSD &>(*abs_thread);
assert(info.pl_lwpid >= 0);
if (info.pl_lwpid == 0 ||
- static_cast<lldb::tid_t>(info.pl_lwpid) == thread.GetID())
+ static_cast<lldb::tid_t>(info.pl_lwpid) == thread.GetID()) {
thread.SetStoppedBySignal(info.pl_siginfo.si_signo, &info.pl_siginfo);
- else
+ SetCurrentThreadID(thread.GetID());
+ } else
thread.SetStoppedWithNoReason();
}
SetState(StateType::eStateStopped, true);
@@ -809,6 +814,9 @@
break;
}
}
+
+ if (GetCurrentThreadID() == thread_id)
+ SetCurrentThreadID(m_threads.front()->GetID());
}
Status NativeProcessFreeBSD::Attach() {
Index: lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
===================================================================
--- lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
+++ lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
@@ -254,6 +254,7 @@
for (const auto &thread : m_threads)
static_cast<NativeThreadFreeBSD &>(*thread).SetStoppedByExec();
+ SetCurrentThreadID(m_threads.front()->GetID());
SetState(StateType::eStateStopped, true);
return;
}
@@ -312,6 +313,7 @@
} else
thread->SetStoppedByBreakpoint();
FixupBreakpointPCAsNeeded(*thread);
+ SetCurrentThreadID(thread->GetID());
}
SetState(StateType::eStateStopped, true);
return;
@@ -333,11 +335,13 @@
if (wp_index != LLDB_INVALID_INDEX32) {
regctx.ClearWatchpointHit(wp_index);
thread->SetStoppedByWatchpoint(wp_index);
+ SetCurrentThreadID(thread->GetID());
SetState(StateType::eStateStopped, true);
break;
}
thread->SetStoppedByTrace();
+ SetCurrentThreadID(thread->GetID());
}
SetState(StateType::eStateStopped, true);
@@ -370,9 +374,10 @@
static_cast<NativeThreadFreeBSD &>(*abs_thread);
assert(info.pl_lwpid >= 0);
if (info.pl_lwpid == 0 ||
- static_cast<lldb::tid_t>(info.pl_lwpid) == thread.GetID())
+ static_cast<lldb::tid_t>(info.pl_lwpid) == thread.GetID()) {
thread.SetStoppedBySignal(info.pl_siginfo.si_signo, &info.pl_siginfo);
- else
+ SetCurrentThreadID(thread.GetID());
+ } else
thread.SetStoppedWithNoReason();
}
SetState(StateType::eStateStopped, true);
@@ -809,6 +814,9 @@
break;
}
}
+
+ if (GetCurrentThreadID() == thread_id)
+ SetCurrentThreadID(m_threads.front()->GetID());
}
Status NativeProcessFreeBSD::Attach() {
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits