diff options
author | Greg Clayton <gclayton@apple.com> | 2015-01-15 02:59:20 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-01-15 02:59:20 +0000 |
commit | 2501e5e2ea0744ae91ca48402101291892a68b73 (patch) | |
tree | b1fff234b945d483b6b4684bc3a79d82d2f2e753 /lldb/source/Core/Address.cpp | |
parent | 6eece29d8ff88a9c90620a9b026fc8304de6f6ea (diff) | |
download | bcm5719-llvm-2501e5e2ea0744ae91ca48402101291892a68b73.tar.gz bcm5719-llvm-2501e5e2ea0744ae91ca48402101291892a68b73.zip |
Modified LLDB to be able to lookup global variables by address.
This is done by adding a "Variable *" to SymbolContext and allowing SymbolFile::ResolveSymbolContext() so if an address is resolved into a symbol context, we can include the global or static variable for that address.
This means you can now find global variables that are merged globals when doing a "image lookup --verbose --address 0x1230000". Previously we would resolve a symbol and show "_MergedGlobals123 + 1234". But now we can show the global variable name.
The eSymbolContextEverything purposely does not include the new eSymbolContextVariable in its lookup since stack frame code does many lookups and we don't want it triggering the global variable lookups.
<rdar://problem/18945678>
llvm-svn: 226084
Diffstat (limited to 'lldb/source/Core/Address.cpp')
-rw-r--r-- | lldb/source/Core/Address.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index a79becbf49c..d449d0b2143 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -654,7 +654,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum if (module_sp) { SymbolContext sc; - module_sp->ResolveSymbolContextForAddress(*this, eSymbolContextEverything, sc); + module_sp->ResolveSymbolContextForAddress(*this, eSymbolContextEverything | eSymbolContextVariable, sc); if (sc.function || sc.symbol) { bool show_stop_context = true; @@ -712,7 +712,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum if (module_sp) { SymbolContext sc; - module_sp->ResolveSymbolContextForAddress(*this, eSymbolContextEverything, sc); + module_sp->ResolveSymbolContextForAddress(*this, eSymbolContextEverything | eSymbolContextVariable, sc); if (sc.symbol) { // If we have just a symbol make sure it is in the same section |