xref: /freebsd/contrib/llvm-project/lldb/include/lldb/Target/VerboseTrapFrameRecognizer.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 #ifndef LLDB_TARGET_VERBOSETRAPFRAMERECOGNIZER_H
2 #define LLDB_TARGET_VERBOSETRAPFRAMERECOGNIZER_H
3 
4 #include "lldb/Target/StackFrameRecognizer.h"
5 
6 namespace lldb_private {
7 
8 void RegisterVerboseTrapFrameRecognizer(Process &process);
9 
10 /// Holds the stack frame that caused the Verbose trap and the inlined stop
11 /// reason message.
12 class VerboseTrapRecognizedStackFrame : public RecognizedStackFrame {
13 public:
14   VerboseTrapRecognizedStackFrame(lldb::StackFrameSP most_relevant_frame_sp,
15                                   std::string stop_desc);
16 
17   lldb::StackFrameSP GetMostRelevantFrame() override;
18 
19 private:
20   lldb::StackFrameSP m_most_relevant_frame;
21 };
22 
23 /// When a thread stops, it checks the current frame contains a
24 /// Verbose Trap diagnostic. If so, it returns a \a
25 /// VerboseTrapRecognizedStackFrame holding the diagnostic a stop reason
26 /// description with and the parent frame as the most relavant frame.
27 class VerboseTrapFrameRecognizer : public StackFrameRecognizer {
28 public:
GetName()29   std::string GetName() override {
30     return "Verbose Trap StackFrame Recognizer";
31   }
32 
33   lldb::RecognizedStackFrameSP
34   RecognizeFrame(lldb::StackFrameSP frame) override;
35 };
36 
37 } // namespace lldb_private
38 
39 #endif // LLDB_TARGET_VERBOSETRAPFRAMERECOGNIZER_H
40