[Lldb-commits] [PATCH] D117103: [lldb] [Process/FreeBSD] Set current thread ID on events
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 12 06:40:41 PST 2022
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() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117103.399316.patch
Type: text/x-patch
Size: 1915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220112/c188a87e/attachment.bin>
More information about the lldb-commits
mailing list