#ifndef liblldb_StackFrameList_h_
#define liblldb_StackFrameList_h_
#include <vector>
#include "lldb/Host/Mutex.h"
#include "lldb/Target/StackFrame.h"
namespace lldb_private {
class StackFrameList
{
public:
StackFrameList (Thread &thread,
const lldb::StackFrameListSP &prev_frames_sp,
bool show_inline_frames);
~StackFrameList();
uint32_t
GetNumFrames (bool can_create = true);
lldb::StackFrameSP
GetFrameAtIndex (uint32_t idx);
lldb::StackFrameSP
GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
lldb::StackFrameSP
GetFrameWithStackID (const StackID &stack_id);
uint32_t
SetSelectedFrame (lldb_private::StackFrame *frame);
uint32_t
GetSelectedFrameIndex () const;
bool
SetSelectedFrameByIndex (uint32_t idx);
void
SetDefaultFileAndLineToSelectedFrame();
void
Clear ();
void
InvalidateFrames (uint32_t start_idx);
void
Dump (Stream *s);
lldb::StackFrameSP
GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
size_t
GetStatus (Stream &strm,
uint32_t first_frame,
uint32_t num_frames,
bool show_frame_info,
uint32_t num_frames_with_source);
protected:
friend class Thread;
bool
SetFrameAtIndex (uint32_t idx, lldb::StackFrameSP &frame_sp);
static void
Merge (std::auto_ptr<StackFrameList>& curr_ap,
lldb::StackFrameListSP& prev_sp);
void
GetFramesUpTo (uint32_t end_idx);
bool
GetAllFramesFetched()
{
return m_concrete_frames_fetched == UINT32_MAX;
}
void
SetAllFramesFetched ()
{
m_concrete_frames_fetched = UINT32_MAX;
}
typedef std::vector<lldb::StackFrameSP> collection;
typedef collection::iterator iterator;
typedef collection::const_iterator const_iterator;
Thread &m_thread;
lldb::StackFrameListSP m_prev_frames_sp;
mutable Mutex m_mutex;
collection m_frames;
uint32_t m_selected_frame_idx;
uint32_t m_concrete_frames_fetched;
bool m_show_inlined_frames;
private:
DISALLOW_COPY_AND_ASSIGN (StackFrameList);
};
}
#endif // liblldb_StackFrameList_h_