1 //===-- StackID.cpp ---------------------------------------------*- 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 #include "lldb/Target/StackID.h" 11 12 // C Includes 13 // C++ Includes 14 // Other libraries and framework includes 15 // Project includes 16 17 using namespace lldb_private; 18 19 //---------------------------------------------------------------------- 20 // StackID constructor 21 //---------------------------------------------------------------------- 22 StackID::StackID() : 23 m_start_address(), 24 m_cfa (0), 25 m_inline_height (0) 26 { 27 } 28 29 //---------------------------------------------------------------------- 30 // StackID constructor with args 31 //---------------------------------------------------------------------- 32 StackID::StackID (const Address& start_address, lldb::addr_t cfa, uint32_t inline_id) : 33 m_start_address (start_address), 34 m_cfa (cfa), 35 m_inline_height (inline_id) 36 { 37 } 38 39 StackID::StackID (lldb::addr_t cfa, uint32_t inline_id) : 40 m_start_address (), 41 m_cfa (cfa), 42 m_inline_height (inline_id) 43 { 44 } 45 46 //---------------------------------------------------------------------- 47 // StackID copy constructor 48 //---------------------------------------------------------------------- 49 StackID::StackID(const StackID& rhs) : 50 m_start_address (rhs.m_start_address), 51 m_cfa (rhs.m_cfa), 52 m_inline_height (rhs.m_inline_height) 53 { 54 } 55 56 //---------------------------------------------------------------------- 57 // StackID assignment operator 58 //---------------------------------------------------------------------- 59 const StackID& 60 StackID::operator=(const StackID& rhs) 61 { 62 if (this != &rhs) 63 { 64 m_start_address = rhs.m_start_address; 65 m_cfa = rhs.m_cfa; 66 m_inline_height = rhs.m_inline_height; 67 } 68 return *this; 69 } 70 71 //---------------------------------------------------------------------- 72 // Destructor 73 //---------------------------------------------------------------------- 74 StackID::~StackID() 75 { 76 } 77 78 bool 79 lldb_private::operator== (const StackID& lhs, const StackID& rhs) 80 { 81 return lhs.GetCallFrameAddress() == rhs.GetCallFrameAddress() && 82 lhs.GetInlineHeight() == rhs.GetInlineHeight() && 83 lhs.GetStartAddress() == rhs.GetStartAddress(); 84 } 85 86 bool 87 lldb_private::operator!= (const StackID& lhs, const StackID& rhs) 88 { 89 return lhs.GetCallFrameAddress() != rhs.GetCallFrameAddress() || 90 lhs.GetInlineHeight() != rhs.GetInlineHeight() || 91 lhs.GetStartAddress() != rhs.GetStartAddress(); 92 } 93 94 bool 95 lldb_private::operator< (const StackID& lhs, const StackID& rhs) 96 { 97 return lhs.GetCallFrameAddress() < rhs.GetCallFrameAddress(); 98 } 99 100