Centralized all disassembly into static functions in source/Core/Disassembler.cpp.
Added the ability to read memory from the target's object files when we aren't
running, so disassembling works before you run!
Cleaned up the API to lldb_private::Target::ReadMemory().
Cleaned up the API to the Disassembler to use actual "lldb_private::Address"
objects instead of just an "addr_t". This is nice because the Address objects
when resolved carry along their section and module which can get us the
object file. This allows Target::ReadMemory to be used when we are not
running.
Added a new lldb_private::Address dump style: DumpStyleDetailedSymbolContext
This will show a full breakdown of what an address points to. To see some
sample output, execute a "image lookup --address <addr>".
Fixed SymbolContext::DumpStopContext(...) to not require a live process in
order to be able to print function and symbol offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107350 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp
index eca278e..7963a1f 100644
--- a/source/Symbol/SymbolContext.cpp
+++ b/source/Symbol/SymbolContext.cpp
@@ -117,11 +117,6 @@
bool show_module
) const
{
- Process *process = NULL;
- if (exe_scope)
- process = exe_scope->CalculateProcess();
- addr_t load_addr = addr.GetLoadAddress (process);
-
if (show_module && module_sp)
{
*s << module_sp->GetFileSpec().GetFilename() << '`';
@@ -132,9 +127,9 @@
if (function->GetMangled().GetName())
function->GetMangled().GetName().Dump(s);
- const addr_t func_load_addr = function->GetAddressRange().GetBaseAddress().GetLoadAddress(process);
- if (load_addr > func_load_addr)
- s->Printf(" + %llu", load_addr - func_load_addr);
+ const addr_t function_offset = addr.GetOffset() - function->GetAddressRange().GetBaseAddress().GetOffset();
+ if (function_offset)
+ s->Printf(" + %llu", function_offset);
if (block != NULL)
{
@@ -158,9 +153,9 @@
if (symbol->GetAddressRangePtr())
{
- const addr_t sym_load_addr = symbol->GetAddressRangePtr()->GetBaseAddress().GetLoadAddress(process);
- if (load_addr > sym_load_addr)
- s->Printf(" + %llu", load_addr - sym_load_addr);
+ const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset();
+ if (symbol_offset)
+ s->Printf(" + %llu", symbol_offset);
}
}
else