We were leaking a stack frame in StackFrameList in Thread.cpp which could
cause extra shared pointer references to one or more modules to be leaked.
This would cause many object files to stay around the life of LLDB, so after
a recompile and rexecution, we would keep adding more and more memory. After
fixing the leak, we found many cases where leaked stack frames were still
being used and causing crashes in the test suite. These are now all resolved.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137516 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBAddress.cpp b/source/API/SBAddress.cpp
index 57b58bf..110ef2d 100644
--- a/source/API/SBAddress.cpp
+++ b/source/API/SBAddress.cpp
@@ -228,4 +228,62 @@
return sb_module;
}
+SBSymbolContext
+SBAddress::GetSymbolContext (uint32_t resolve_scope)
+{
+ SBSymbolContext sb_sc;
+ if (m_opaque_ap.get())
+ m_opaque_ap->CalculateSymbolContext (&sb_sc.ref(), resolve_scope);
+ return sb_sc;
+}
+
+SBCompileUnit
+SBAddress::GetCompileUnit ()
+{
+ SBCompileUnit sb_comp_unit;
+ if (m_opaque_ap.get())
+ sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
+ return sb_comp_unit;
+}
+
+SBFunction
+SBAddress::GetFunction ()
+{
+ SBFunction sb_function;
+ if (m_opaque_ap.get())
+ sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
+ return sb_function;
+}
+
+SBBlock
+SBAddress::GetBlock ()
+{
+ SBBlock sb_block;
+ if (m_opaque_ap.get())
+ sb_block.reset(m_opaque_ap->CalculateSymbolContextBlock());
+ return sb_block;
+}
+
+SBSymbol
+SBAddress::GetSymbol ()
+{
+ SBSymbol sb_symbol;
+ if (m_opaque_ap.get())
+ sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
+ return sb_symbol;
+}
+
+SBLineEntry
+SBAddress::GetLineEntry ()
+{
+ SBLineEntry sb_line_entry;
+ if (m_opaque_ap.get())
+ {
+ LineEntry line_entry;
+ if (m_opaque_ap->CalculateSymbolContextLineEntry (line_entry))
+ sb_line_entry.SetLineEntry (line_entry);
+ }
+ return sb_line_entry;
+}
+