summaryrefslogtreecommitdiff
path: root/lldb/source/API/SBThread.cpp
diff options
context:
space:
mode:
authorMichał Górny <mgorny@moritz.systems>2021-03-29 17:05:30 +0200
committerMichał Górny <mgorny@moritz.systems>2021-04-24 11:08:33 +0200
commit6c37984ebaf4ee01df6a9b3f78e45f70dcd6fb33 (patch)
treeec43c115b6c54721218a02145f9bc0a002da4f02 /lldb/source/API/SBThread.cpp
parent312257688eb0c09a8e6915ced2acdf0bcbbad353 (diff)
[lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork
Introduce three new stop reasons for fork, vfork and vforkdone events. This includes server support for serializing fork/vfork events into gdb-remote protocol. The stop infos for the two base events take a pair of PID and TID for the newly forked process. Differential Revision: https://reviews.llvm.org/D100196
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r--lldb/source/API/SBThread.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index 4a1b53d4a592..7b3d93905cce 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -173,6 +173,7 @@ size_t SBThread::GetStopReasonDataCount() {
case eStopReasonThreadExiting:
case eStopReasonInstrumentation:
case eStopReasonProcessorTrace:
+ case eStopReasonVForkDone:
// There is no data for these stop reasons.
return 0;
@@ -195,6 +196,12 @@ size_t SBThread::GetStopReasonDataCount() {
case eStopReasonException:
return 1;
+
+ case eStopReasonFork:
+ return 1;
+
+ case eStopReasonVFork:
+ return 1;
}
}
}
@@ -225,6 +232,7 @@ uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx) {
case eStopReasonThreadExiting:
case eStopReasonInstrumentation:
case eStopReasonProcessorTrace:
+ case eStopReasonVForkDone:
// There is no data for these stop reasons.
return 0;
@@ -258,6 +266,12 @@ uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx) {
case eStopReasonException:
return stop_info_sp->GetValue();
+
+ case eStopReasonFork:
+ return stop_info_sp->GetValue();
+
+ case eStopReasonVFork:
+ return stop_info_sp->GetValue();
}
}
}