diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-06-08 16:52:24 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-06-08 16:52:24 +0000 |
| commit | 30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c (patch) | |
| tree | f70013106f6a461a14abcd71c65f48a95a2979a6 /lldb/source/Target/StackID.cpp | |
| parent | 312c4c799da215b337f790fda330f70c4aa757cf (diff) | |
Initial checkin of lldb code from internal Apple repo.
llvm-svn: 105619
Diffstat (limited to 'lldb/source/Target/StackID.cpp')
| -rw-r--r-- | lldb/source/Target/StackID.cpp | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/lldb/source/Target/StackID.cpp b/lldb/source/Target/StackID.cpp new file mode 100644 index 000000000000..6f903aed6da6 --- /dev/null +++ b/lldb/source/Target/StackID.cpp @@ -0,0 +1,110 @@ +//===-- StackID.cpp ---------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Target/StackID.h" + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes + +using namespace lldb_private; + +//---------------------------------------------------------------------- +// StackID constructor +//---------------------------------------------------------------------- +StackID::StackID() : + m_start_address(), + m_cfa() +{ +} + +//---------------------------------------------------------------------- +// StackID constructor with args +//---------------------------------------------------------------------- +StackID::StackID (const Address& start_address, lldb::addr_t cfa) : + m_start_address (start_address), + m_cfa (cfa) +{ +} + +StackID::StackID (lldb::addr_t cfa) : + m_start_address (), + m_cfa (cfa) +{ +} + +//---------------------------------------------------------------------- +// StackID copy constructor +//---------------------------------------------------------------------- +StackID::StackID(const StackID& rhs) : + m_start_address (rhs.m_start_address), + m_cfa (rhs.m_cfa) +{ +} + +//---------------------------------------------------------------------- +// StackID assignment operator +//---------------------------------------------------------------------- +const StackID& +StackID::operator=(const StackID& rhs) +{ + if (this != &rhs) + { + m_start_address = rhs.m_start_address; + m_cfa = rhs.m_cfa; + } + return *this; +} + +//---------------------------------------------------------------------- +// Destructor +//---------------------------------------------------------------------- +StackID::~StackID() +{ +} + + +const Address& +StackID::GetStartAddress() const +{ + return m_start_address; +} + +void +StackID::SetStartAddress(const Address& start_address) +{ + m_start_address = start_address; +} + +lldb::addr_t +StackID::GetCallFrameAddress() const +{ + return m_cfa; +} + + +bool +lldb_private::operator== (const StackID& lhs, const StackID& rhs) +{ + return lhs.GetCallFrameAddress() == rhs.GetCallFrameAddress() && lhs.GetStartAddress() == rhs.GetStartAddress(); +} + +bool +lldb_private::operator!= (const StackID& lhs, const StackID& rhs) +{ + return lhs.GetCallFrameAddress() != rhs.GetCallFrameAddress() || lhs.GetStartAddress() != rhs.GetStartAddress(); +} + +bool +lldb_private::operator< (const StackID& lhs, const StackID& rhs) +{ + return lhs.GetCallFrameAddress() < rhs.GetCallFrameAddress(); +} + |
