diff options
Diffstat (limited to 'source/Symbol/SymbolContext.cpp')
-rw-r--r-- | source/Symbol/SymbolContext.cpp | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp index 62ae6ac..8e4240a 100644 --- a/source/Symbol/SymbolContext.cpp +++ b/source/Symbol/SymbolContext.cpp @@ -129,15 +129,15 @@ SymbolContext::Clear(bool clear_target) } bool -SymbolContext::DumpStopContext -( +SymbolContext::DumpStopContext ( Stream *s, ExecutionContextScope *exe_scope, const Address &addr, bool show_fullpaths, bool show_module, bool show_inlined_frames, - bool show_function_arguments + bool show_function_arguments, + bool show_function_name ) const { bool dumped_something = false; @@ -155,7 +155,12 @@ SymbolContext::DumpStopContext { SymbolContext inline_parent_sc; Address inline_parent_addr; - if (show_function_arguments == false && function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments)) + if (show_function_name == false) + { + s->Printf("<"); + dumped_something = true; + } + else if (show_function_arguments == false && function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments)) { dumped_something = true; function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments).Dump(s); @@ -169,7 +174,13 @@ SymbolContext::DumpStopContext if (addr.IsValid()) { const addr_t function_offset = addr.GetOffset() - function->GetAddressRange().GetBaseAddress().GetOffset(); - if (function_offset) + if (show_function_name == false) + { + // Print +offset even if offset is 0 + dumped_something = true; + s->Printf("+%" PRIu64 ">", function_offset); + } + else if (function_offset) { dumped_something = true; s->Printf(" + %" PRIu64, function_offset); @@ -202,7 +213,8 @@ SymbolContext::DumpStopContext { s->EOL(); s->Indent(); - return inline_parent_sc.DumpStopContext (s, exe_scope, inline_parent_addr, show_fullpaths, show_module, show_inlined_frames, show_function_arguments); + const bool show_function_name = true; + return inline_parent_sc.DumpStopContext (s, exe_scope, inline_parent_addr, show_fullpaths, show_module, show_inlined_frames, show_function_arguments, show_function_name); } } else @@ -218,7 +230,12 @@ SymbolContext::DumpStopContext } else if (symbol != nullptr) { - if (symbol->GetMangled().GetName()) + if (show_function_name == false) + { + s->Printf("<"); + dumped_something = true; + } + else if (symbol->GetMangled().GetName()) { dumped_something = true; if (symbol->GetType() == eSymbolTypeTrampoline) @@ -228,8 +245,14 @@ SymbolContext::DumpStopContext if (addr.IsValid() && symbol->ValueIsAddress()) { - const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddress().GetOffset(); - if (symbol_offset) + const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddressRef().GetOffset(); + if (show_function_name == false) + { + // Print +offset even if offset is 0 + dumped_something = true; + s->Printf("+%" PRIu64 ">", symbol_offset); + } + else if (symbol_offset) { dumped_something = true; s->Printf(" + %" PRIu64, symbol_offset); @@ -492,7 +515,7 @@ SymbolContext::GetAddressRange (uint32_t scope, { if (symbol->ValueIsAddress()) { - range.GetBaseAddress() = symbol->GetAddress(); + range.GetBaseAddress() = symbol->GetAddressRef(); range.SetByteSize (symbol->GetByteSize()); return true; } @@ -1083,7 +1106,7 @@ SymbolContextList::AppendIfUnique (const SymbolContext& sc, bool merge_symbol_in if (pos->function) { - if (pos->function->GetAddressRange().GetBaseAddress() == sc.symbol->GetAddress()) + if (pos->function->GetAddressRange().GetBaseAddress() == sc.symbol->GetAddressRef()) { // Do we already have a function with this symbol? if (pos->symbol == sc.symbol) @@ -1125,7 +1148,7 @@ SymbolContextList::MergeSymbolContextIntoFunctionContext (const SymbolContext& s if (function_sc.function) { - if (function_sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddress()) + if (function_sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddressRef()) { // Do we already have a function with this symbol? if (function_sc.symbol == symbol_sc.symbol) |