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_
18 // Other libraries and framework includes
20 #include "lldb/Host/Mutex.h"
21 #include "lldb/Target/StackFrame.h"
23 namespace lldb_private {
28 //------------------------------------------------------------------
29 // Constructors and Destructors
30 //------------------------------------------------------------------
31 StackFrameList (Thread &thread,
32 const lldb::StackFrameListSP &prev_frames_sp,
33 bool show_inline_frames);
38 GetNumFrames (bool can_create = true);
41 GetFrameAtIndex (uint32_t idx);
44 GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
47 GetFrameWithStackID (const StackID &stack_id);
49 // Mark a stack frame as the current frame
51 SetSelectedFrame (lldb_private::StackFrame *frame);
54 GetSelectedFrameIndex () const;
56 // Mark a stack frame as the current frame using the frame index
58 SetSelectedFrameByIndex (uint32_t idx);
61 GetVisibleStackFrameIndex(uint32_t idx)
63 if (m_current_inlined_depth < UINT32_MAX)
64 return idx - m_current_inlined_depth;
70 CalculateCurrentInlinedDepth ();
73 SetDefaultFileAndLineToSelectedFrame();
79 InvalidateFrames (uint32_t start_idx);
85 GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
88 GetStatus(Stream &strm,
92 uint32_t num_frames_with_source,
93 const char *frame_marker = nullptr);
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 typedef std::vector<lldb::StackFrameSP> collection;
133 typedef collection::iterator iterator;
134 typedef collection::const_iterator const_iterator;
137 lldb::StackFrameListSP m_prev_frames_sp;
138 mutable Mutex m_mutex;
140 uint32_t m_selected_frame_idx;
141 uint32_t m_concrete_frames_fetched;
142 uint32_t m_current_inlined_depth;
143 lldb::addr_t m_current_inlined_pc;
144 bool m_show_inlined_frames;
147 DISALLOW_COPY_AND_ASSIGN (StackFrameList);
150 } // namespace lldb_private
152 #endif // liblldb_StackFrameList_h_