diff options
Diffstat (limited to 'lldb/source/Target/StopInfo.cpp')
| -rw-r--r-- | lldb/source/Target/StopInfo.cpp | 28 |
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)); } |
