summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/SymbolContext.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-03-07 21:03:09 +0000
committerGreg Clayton <gclayton@apple.com>2012-03-07 21:03:09 +0000
commite761213428bb1ad8a8835ac4bf52233ae2121f3c (patch)
tree746b13d7e3e796f69acc994362c23f732a380542 /lldb/source/Symbol/SymbolContext.cpp
parent377f1f2d399171983cc26c13e81bad1699025dde (diff)
downloadbcm5719-llvm-e761213428bb1ad8a8835ac4bf52233ae2121f3c.tar.gz
bcm5719-llvm-e761213428bb1ad8a8835ac4bf52233ae2121f3c.zip
<rdar://problem/10997402>
This fix really needed to happen as a previous fix I had submitted for calculating symbol sizes made many symbols appear to have zero size since the function that was calculating the symbol size was calling another function that would cause the calculation to happen again. This resulted in some symbols having zero size when they shouldn't. This could then cause infinite stack traces and many other side affects. llvm-svn: 152244
Diffstat (limited to 'lldb/source/Symbol/SymbolContext.cpp')
-rw-r--r--lldb/source/Symbol/SymbolContext.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp
index 1c764e89ef5..3fff6fbc52c 100644
--- a/lldb/source/Symbol/SymbolContext.cpp
+++ b/lldb/source/Symbol/SymbolContext.cpp
@@ -206,9 +206,9 @@ SymbolContext::DumpStopContext
symbol->GetMangled().GetName().Dump(s);
}
- if (addr.IsValid() && symbol->GetAddressRangePtr())
+ if (addr.IsValid() && symbol->ValueIsAddress())
{
- const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset();
+ const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddress().GetOffset();
if (symbol_offset)
{
dumped_something = true;
@@ -431,10 +431,10 @@ SymbolContext::GetAddressRange (uint32_t scope,
{
if (range_idx == 0)
{
- const AddressRange *range_ptr = symbol->GetAddressRangePtr();
- if (range_ptr)
+ if (symbol->ValueIsAddress())
{
- range = *range_ptr;
+ range.GetBaseAddress() = symbol->GetAddress();
+ range.SetByteSize (symbol->GetByteSize());
return true;
}
}
@@ -551,7 +551,7 @@ SymbolContext::GetFunctionName (Mangled::NamePreference preference)
}
return function->GetMangled().GetName(preference);
}
- else if (symbol && symbol->GetAddressRangePtr())
+ else if (symbol && symbol->ValueIsAddress())
{
return symbol->GetMangled().GetName(preference);
}
@@ -934,14 +934,13 @@ SymbolContextList::AppendIfUnique (const SymbolContext& sc, bool merge_symbol_in
&& sc.block == NULL
&& sc.line_entry.IsValid() == false)
{
- const AddressRange *symbol_range = sc.symbol->GetAddressRangePtr();
- if (symbol_range)
+ if (sc.symbol->ValueIsAddress())
{
for (pos = m_symbol_contexts.begin(); pos != end; ++pos)
{
if (pos->function)
{
- if (pos->function->GetAddressRange().GetBaseAddress() == symbol_range->GetBaseAddress())
+ if (pos->function->GetAddressRange().GetBaseAddress() == sc.symbol->GetAddress())
{
// Do we already have a function with this symbol?
if (pos->symbol == sc.symbol)
OpenPOWER on IntegriCloud