diff options
author | Ed Maste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 5e95aa85bb660d45e9905ef1d7180b2678280660 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Symbol/SymbolContext.cpp | |
parent | 12bd4897ff0678fa663e09d78ebc22dd255ceb86 (diff) | |
download | src-5e95aa85bb660d45e9905ef1d7180b2678280660.tar.gz src-5e95aa85bb660d45e9905ef1d7180b2678280660.zip |
Import LLDB as of upstream SVN 241361 (git 612c075f)vendor/lldb/lldb-r241361
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=285101
svn path=/vendor/lldb/lldb-r241361/; revision=285102; tag=vendor/lldb/lldb-r241361
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 62ae6ac464ce..8e4240a4587d 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) |