1717#include " lldb/lldb-private-forward.h"
1818#include " lldb/lldb-public.h"
1919
20- #include < cstdint>
2120#include < deque>
2221#include < optional>
2322#include < vector>
@@ -29,23 +28,20 @@ namespace lldb_private {
2928// / This class provides extra information about a stack frame that was
3029// / provided by a specific stack frame recognizer. Right now, this class only
3130// / holds recognized arguments (via GetRecognizedArguments).
31+
3232class RecognizedStackFrame
3333 : public std::enable_shared_from_this<RecognizedStackFrame> {
3434public:
35- virtual ~RecognizedStackFrame () = default ;
36-
3735 virtual lldb::ValueObjectListSP GetRecognizedArguments () {
3836 return m_arguments;
3937 }
4038 virtual lldb::ValueObjectSP GetExceptionObject () {
4139 return lldb::ValueObjectSP ();
4240 }
43- virtual lldb::StackFrameSP GetMostRelevantFrame () { return nullptr ; }
41+ virtual lldb::StackFrameSP GetMostRelevantFrame () { return nullptr ; };
42+ virtual ~RecognizedStackFrame () = default ;
4443
4544 std::string GetStopDescription () { return m_stop_desc; }
46- // / Controls whether this frame should be filtered out when
47- // / displaying backtraces, for example.
48- virtual bool ShouldHide () { return false ; }
4945
5046protected:
5147 lldb::ValueObjectListSP m_arguments;
@@ -57,6 +53,7 @@ class RecognizedStackFrame
5753// / A base class for frame recognizers. Subclasses (actual frame recognizers)
5854// / should implement RecognizeFrame to provide a RecognizedStackFrame for a
5955// / given stack frame.
56+
6057class StackFrameRecognizer
6158 : public std::enable_shared_from_this<StackFrameRecognizer> {
6259public:
@@ -76,10 +73,10 @@ class StackFrameRecognizer
7673// / Python implementation for frame recognizers. An instance of this class
7774// / tracks a particular Python classobject, which will be asked to recognize
7875// / stack frames.
76+
7977class ScriptedStackFrameRecognizer : public StackFrameRecognizer {
8078 lldb_private::ScriptInterpreter *m_interpreter;
8179 lldb_private::StructuredData::ObjectSP m_python_object_sp;
82-
8380 std::string m_python_class;
8481
8582public:
@@ -126,14 +123,8 @@ class StackFrameRecognizerManager {
126123 lldb::StackFrameRecognizerSP GetRecognizerForFrame (lldb::StackFrameSP frame);
127124
128125 lldb::RecognizedStackFrameSP RecognizeFrame (lldb::StackFrameSP frame);
129- // / Returns a number that changes whenever the list of recognizers
130- // / has been modified.
131- uint16_t GetGeneration () const { return m_generation; }
132126
133127private:
134- // / Increase the generation counter.
135- void BumpGeneration ();
136-
137128 struct RegisteredEntry {
138129 uint32_t recognizer_id;
139130 lldb::StackFrameRecognizerSP recognizer;
@@ -146,14 +137,14 @@ class StackFrameRecognizerManager {
146137 };
147138
148139 std::deque<RegisteredEntry> m_recognizers;
149- uint16_t m_generation;
150140};
151141
152142// / \class ValueObjectRecognizerSynthesizedValue
153143// /
154144// / ValueObject subclass that presents the passed ValueObject as a recognized
155145// / value with the specified ValueType. Frame recognizers should return
156146// / instances of this class as the returned objects in GetRecognizedArguments().
147+
157148class ValueObjectRecognizerSynthesizedValue : public ValueObject {
158149 public:
159150 static lldb::ValueObjectSP Create (ValueObject &parent, lldb::ValueType type) {
0 commit comments