1 //===-- StackFrameList.h ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_StackFrameList_h_
11 #define liblldb_StackFrameList_h_
17 // Other libraries and framework includes
19 #include "lldb/Host/Mutex.h"
20 #include "lldb/Target/StackFrame.h"
22 namespace lldb_private {
27 //------------------------------------------------------------------
28 // Constructors and Destructors
29 //------------------------------------------------------------------
30 StackFrameList (Thread &thread,
31 const lldb::StackFrameListSP &prev_frames_sp,
32 bool show_inline_frames);
37 GetNumFrames (bool can_create = true);
40 GetFrameAtIndex (uint32_t idx);
43 GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
46 GetFrameWithStackID (const StackID &stack_id);
48 // Mark a stack frame as the current frame
50 SetSelectedFrame (lldb_private::StackFrame *frame);
53 GetSelectedFrameIndex () const;
55 // Mark a stack frame as the current frame using the frame index
57 SetSelectedFrameByIndex (uint32_t idx);
60 GetVisibleStackFrameIndex(uint32_t idx)
62 if (m_current_inlined_depth < UINT32_MAX)
63 return idx - m_current_inlined_depth;
69 CalculateCurrentInlinedDepth ();
72 SetDefaultFileAndLineToSelectedFrame();
78 InvalidateFrames (uint32_t start_idx);
84 GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
87 GetStatus (Stream &strm,
91 uint32_t num_frames_with_source,
92 const char *frame_marker = NULL);
99 SetFrameAtIndex (uint32_t idx, lldb::StackFrameSP &frame_sp);
102 Merge (std::unique_ptr<StackFrameList>& curr_ap,
103 lldb::StackFrameListSP& prev_sp);
106 GetFramesUpTo (uint32_t end_idx);
109 GetAllFramesFetched()
111 return m_concrete_frames_fetched == UINT32_MAX;
115 SetAllFramesFetched ()
117 m_concrete_frames_fetched = UINT32_MAX;
121 DecrementCurrentInlinedDepth ();
124 ResetCurrentInlinedDepth();
127 GetCurrentInlinedDepth ();
130 SetCurrentInlinedDepth (uint32_t new_depth);
132 //------------------------------------------------------------------
133 // Classes that inherit from StackFrameList can see and modify these
134 //------------------------------------------------------------------
135 typedef std::vector<lldb::StackFrameSP> collection;
136 typedef collection::iterator iterator;
137 typedef collection::const_iterator const_iterator;
140 lldb::StackFrameListSP m_prev_frames_sp;
141 mutable Mutex m_mutex;
143 uint32_t m_selected_frame_idx;
144 uint32_t m_concrete_frames_fetched;
145 uint32_t m_current_inlined_depth;
146 lldb::addr_t m_current_inlined_pc;
147 bool m_show_inlined_frames;
150 //------------------------------------------------------------------
151 // For StackFrameList only
152 //------------------------------------------------------------------
153 DISALLOW_COPY_AND_ASSIGN (StackFrameList);
156 } // namespace lldb_private
158 #endif // liblldb_StackFrameList_h_