summaryrefslogtreecommitdiff
path: root/lldb/source/Target/StopInfo.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2024-08-07 14:00:51 -0700
committerFlorian Mayer <fmayer@google.com>2024-08-07 14:00:51 -0700
commit10fbc246b146dbdf6b7cd9083bf392505c534fbc (patch)
tree898a2504a8bc941166603c77021937fd995e79ce /lldb/source/Target/StopInfo.cpp
parent191d02015fba3458bdf6381ee93c32e485daf25e (diff)
parenta05fa131db58f2d66a1f9e68fea74068f9218c2b (diff)
Created using spr 1.3.4
Diffstat (limited to 'lldb/source/Target/StopInfo.cpp')
-rw-r--r--lldb/source/Target/StopInfo.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp
index 95f78056b164..bd7032b803df 100644
--- a/lldb/source/Target/StopInfo.cpp
+++ b/lldb/source/Target/StopInfo.cpp
@@ -1125,6 +1125,29 @@ private:
std::optional<int> m_code;
};
+// StopInfoInterrupt
+
+class StopInfoInterrupt : public StopInfo {
+public:
+ StopInfoInterrupt(Thread &thread, int signo, const char *description)
+ : StopInfo(thread, signo) {
+ SetDescription(description);
+ }
+
+ ~StopInfoInterrupt() override = default;
+
+ StopReason GetStopReason() const override {
+ return lldb::eStopReasonInterrupt;
+ }
+
+ const char *GetDescription() override {
+ if (m_description.empty()) {
+ m_description = "async interrupt";
+ }
+ return m_description.c_str();
+ }
+};
+
// StopInfoTrace
class StopInfoTrace : public StopInfo {
@@ -1390,6 +1413,11 @@ StopInfoSP StopInfo::CreateStopReasonWithSignal(Thread &thread, int signo,
return StopInfoSP(new StopInfoUnixSignal(thread, signo, description, code));
}
+StopInfoSP StopInfo::CreateStopReasonWithInterrupt(Thread &thread, int signo,
+ const char *description) {
+ return StopInfoSP(new StopInfoInterrupt(thread, signo, description));
+}
+
StopInfoSP StopInfo::CreateStopReasonToTrace(Thread &thread) {
return StopInfoSP(new StopInfoTrace(thread));
}