summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/StackID.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-08-30 18:11:35 +0000
committerGreg Clayton <gclayton@apple.com>2010-08-30 18:11:35 +0000
commit59e8fc1c7404de213591bc416bb7800539bfc575 (patch)
treeece73e90414bf24f5f03a292aaa6bd7777b5fa5e /lldb/source/Target/StackID.cpp
parente2f8bdac14c92de971852eb41dd0f70d202953f4 (diff)
downloadbcm5719-llvm-59e8fc1c7404de213591bc416bb7800539bfc575.tar.gz
bcm5719-llvm-59e8fc1c7404de213591bc416bb7800539bfc575.zip
Clarified the intent of the SymbolContextScope class in the header
documentation. Symbol now inherits from the symbol context scope so that the StackID can use a "SymbolContextScope *" instead of a blockID (which could have been the same as some other blockID from another symbol file). Modified the stacks that are created on subsequent stops to reuse the previous stack frame objects which will allow for some internal optimization using pointer comparisons during stepping. llvm-svn: 112495
Diffstat (limited to 'lldb/source/Target/StackID.cpp')
-rw-r--r--lldb/source/Target/StackID.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/lldb/source/Target/StackID.cpp b/lldb/source/Target/StackID.cpp
index 6d34d3b1770..215e85e8fea 100644
--- a/lldb/source/Target/StackID.cpp
+++ b/lldb/source/Target/StackID.cpp
@@ -13,15 +13,36 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/Symbol.h"
+#include "lldb/Symbol/SymbolContext.h"
using namespace lldb_private;
+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(") ");
+}
+
bool
lldb_private::operator== (const StackID& lhs, const StackID& rhs)
{
return lhs.GetCallFrameAddress() == rhs.GetCallFrameAddress() &&
- lhs.GetInlineBlockID() == rhs.GetInlineBlockID() &&
+ lhs.GetSymbolContextScope() == rhs.GetSymbolContextScope() &&
lhs.GetStartAddress() == rhs.GetStartAddress();
}
@@ -29,14 +50,12 @@ bool
lldb_private::operator!= (const StackID& lhs, const StackID& rhs)
{
return lhs.GetCallFrameAddress() != rhs.GetCallFrameAddress() ||
- lhs.GetInlineBlockID() != rhs.GetInlineBlockID() ||
+ lhs.GetSymbolContextScope() != rhs.GetSymbolContextScope() ||
lhs.GetStartAddress() != rhs.GetStartAddress();
}
bool
lldb_private::operator< (const StackID& lhs, const StackID& rhs)
{
- if (lhs.GetCallFrameAddress() < rhs.GetCallFrameAddress())
- return true;
- return lhs.GetInlineBlockID() < rhs.GetInlineBlockID();
+ return lhs.GetCallFrameAddress() < rhs.GetCallFrameAddress();
}
OpenPOWER on IntegriCloud