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. 



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112495 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/StackID.cpp b/source/Target/StackID.cpp
index 6d34d3b..215e85e 100644
--- a/source/Target/StackID.cpp
+++ b/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 @@
 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();
 }