================
@@ -117,6 +117,68 @@ struct MemoryEventBody {
};
llvm::json::Value toJSON(const MemoryEventBody &);
+enum StopReason : unsigned {
+ eStopReasonInvalid,
+ eStopReasonStep,
+ eStopReasonBreakpoint,
+ eStopReasonException,
+ eStopReasonPause,
+ eStopReasonEntry,
+ eStopReasonGoto,
+ eStopReasonFunctionBreakpoint,
+ eStopReasonDataBreakpoint,
+ eStopReasonInstructionBreakpoint,
+};
+
+/// The event indicates that the execution of the debuggee has stopped due to
+/// some condition.
+///
+/// This can be caused by a breakpoint previously set, a stepping request has
+/// completed, by executing a debugger statement etc.
+struct StoppedEventBody {
+ /// The reason for the event.
+ ///
+ /// For backward compatibility this string is shown in the UI if the
+ /// `description` attribute is missing (but it must not be translated).
+ StopReason reason = eStopReasonInvalid;
+
+ /// The full reason for the event, e.g. 'Paused on exception'. This string is
+ /// shown in the UI as is and can be translated.
+ std::string description;
+
+ /// The thread which was stopped.
+ lldb::tid_t threadId = LLDB_INVALID_THREAD_ID;
+
+ /// A value of true hints to the client that this event should not change the
+ /// focus.
+ bool preserveFocusHint = false;
+
+ /// Additional information. E.g. if reason is `exception`, text contains the
+ /// exception name. This string is shown in the UI.
+ std::string text;
+
+ /// "If `allThreadsStopped` is true, a debug adapter can announce that all
+ /// threads have stopped.
+ ///
+ /// - The client should use this information to enable that all threads can
be
+ /// expanded to access their stacktraces.
+ /// - If the attribute is missing or false, only the thread with the given
+ /// `threadId` can be expanded.
+ bool allThreadsStopped = false;
+
+ /// Ids of the breakpoints that triggered the event. In most cases there is
+ /// only a single breakpoint but here are some examples for multiple
+ /// breakpoints:
+ ///
+ /// - Different types of breakpoints map to the same location.
+ /// - Multiple source breakpoints get collapsed to the same instruction by
the
+ /// compiler/runtime.
+ /// - Multiple function breakpoints with different function names map to the
+ /// same location.
+ std::vector<lldb::break_id_t> hitBreakpointIds;
+};
+llvm::json::Value toJSON(const StoppedEventBody &);
----------------
DrSergei wrote:
Could you add test for serialization
https://github.com/llvm/llvm-project/pull/176273
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits