StackID.h revision 33ed170599d41fe407a4dcf5f0875c75e1ad1375
1//===-- StackID.h -----------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef liblldb_StackID_h_ 11#define liblldb_StackID_h_ 12 13// C Includes 14// C++ Includes 15// Other libraries and framework includes 16// Project includes 17#include "lldb/lldb-private.h" 18#include "lldb/Core/AddressRange.h" 19 20namespace lldb_private { 21 22class StackID 23{ 24public: 25 //------------------------------------------------------------------ 26 // Constructors and Destructors 27 //------------------------------------------------------------------ 28 StackID (); 29 explicit StackID (lldb::addr_t cfa, uint32_t inline_id); 30 StackID (const Address& start_address, lldb::addr_t cfa, uint32_t inline_id); 31 StackID (const StackID& rhs); 32 virtual ~StackID(); 33 34 const Address& 35 GetStartAddress() const 36 { 37 return m_start_address; 38 } 39 40 void 41 SetStartAddress(const Address& start_address) 42 { 43 m_start_address = start_address; 44 } 45 46 lldb::addr_t 47 GetCallFrameAddress() const 48 { 49 return m_cfa; 50 } 51 52 uint32_t 53 GetInlineHeight () const 54 { 55 return m_inline_height; 56 } 57 //------------------------------------------------------------------ 58 // Operators 59 //------------------------------------------------------------------ 60 const StackID& 61 operator=(const StackID& rhs); 62 63protected: 64 //------------------------------------------------------------------ 65 // Classes that inherit from StackID can see and modify these 66 //------------------------------------------------------------------ 67 Address m_start_address; // The address range for the function for this frame 68 lldb::addr_t m_cfa; // The call frame address (stack pointer) value 69 // at the beginning of the function that uniquely 70 // identifies this frame (along with m_inline_height below) 71 uint32_t m_inline_height; // The inline height of a stack frame. Zero is the actual 72 // value for the place where a thread stops, 1 and above 73 // are for the inlined frames above the concrete base frame. 74}; 75 76bool operator== (const StackID& lhs, const StackID& rhs); 77bool operator!= (const StackID& lhs, const StackID& rhs); 78bool operator< (const StackID& lhs, const StackID& rhs); 79 80} // namespace lldb_private 81 82#endif // liblldb_StackID_h_ 83