2010-06-09 00:52:24 +08:00
|
|
|
//===-- 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
|
2010-08-31 02:11:35 +08:00
|
|
|
#include "lldb/Core/Stream.h"
|
|
|
|
#include "lldb/Symbol/Block.h"
|
|
|
|
#include "lldb/Symbol/Symbol.h"
|
|
|
|
#include "lldb/Symbol/SymbolContext.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
|
2010-08-31 02:11:35 +08:00
|
|
|
void
|
|
|
|
StackID::Dump (Stream *s)
|
|
|
|
{
|
|
|
|
s->Printf("StackID (start_pc = 0x%16.16llx, cfa = 0x%16.16llx, symbol_scope = %p", (uint64_t)m_start_pc, (uint64_t)m_cfa, m_symbol_scope);
|
|
|
|
if (m_symbol_scope)
|
|
|
|
{
|
|
|
|
SymbolContext sc;
|
|
|
|
|
|
|
|
m_symbol_scope->CalculateSymbolContext (&sc);
|
|
|
|
if (sc.block)
|
|
|
|
s->Printf(" (Block {0x%8.8x})", sc.block->GetID());
|
|
|
|
else if (sc.symbol)
|
|
|
|
s->Printf(" (Symbol{0x%8.8x})", sc.symbol->GetID());
|
|
|
|
}
|
|
|
|
s->PutCString(") ");
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
bool
|
|
|
|
lldb_private::operator== (const StackID& lhs, const StackID& rhs)
|
|
|
|
{
|
2010-08-26 10:28:22 +08:00
|
|
|
return lhs.GetCallFrameAddress() == rhs.GetCallFrameAddress() &&
|
2010-08-31 02:11:35 +08:00
|
|
|
lhs.GetSymbolContextScope() == rhs.GetSymbolContextScope() &&
|
2010-08-26 10:28:22 +08:00
|
|
|
lhs.GetStartAddress() == rhs.GetStartAddress();
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
lldb_private::operator!= (const StackID& lhs, const StackID& rhs)
|
|
|
|
{
|
2010-08-26 10:28:22 +08:00
|
|
|
return lhs.GetCallFrameAddress() != rhs.GetCallFrameAddress() ||
|
2010-08-31 02:11:35 +08:00
|
|
|
lhs.GetSymbolContextScope() != rhs.GetSymbolContextScope() ||
|
2010-08-26 10:28:22 +08:00
|
|
|
lhs.GetStartAddress() != rhs.GetStartAddress();
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
lldb_private::operator< (const StackID& lhs, const StackID& rhs)
|
|
|
|
{
|
2010-08-31 02:11:35 +08:00
|
|
|
return lhs.GetCallFrameAddress() < rhs.GetCallFrameAddress();
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|