summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/DataExtractor.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-03-28 23:42:53 +0000
committerGreg Clayton <gclayton@apple.com>2013-03-28 23:42:53 +0000
commit3faf47c46225b0f56c14235550d363ae90f4f1c6 (patch)
tree979adba317d03734d4d237552cfaf1cbc2bb7088 /lldb/source/Core/DataExtractor.cpp
parenta486a11dcfaa9f31d78eb52929d8d33c56e9cf60 (diff)
downloadbcm5719-llvm-3faf47c46225b0f56c14235550d363ae90f4f1c6.tar.gz
bcm5719-llvm-3faf47c46225b0f56c14235550d363ae90f4f1c6.zip
<rdar://problem/11730263>
PC relative loads are missing disassembly comments when disassembled in a live process. This issue was because some sections, like __TEXT and __DATA in libobjc.A.dylib, were being moved when they were put into the dyld shared cache. This could also affect any other system that slides sections individually. The solution is to keep track of wether the bytes we will disassemble are from an executable file (file address), or from a live process (load address). We now do the right thing based off of this input in all cases. llvm-svn: 178315
Diffstat (limited to 'lldb/source/Core/DataExtractor.cpp')
-rw-r--r--lldb/source/Core/DataExtractor.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp
index c1d7770cfe7..75f022a1dbd 100644
--- a/lldb/source/Core/DataExtractor.cpp
+++ b/lldb/source/Core/DataExtractor.cpp
@@ -1328,13 +1328,18 @@ DataExtractor::Dump (Stream *s,
{
lldb::addr_t addr = base_addr + start_offset;
lldb_private::Address so_addr;
- if (!target_sp->GetSectionLoadList().ResolveLoadAddress(addr, so_addr))
+ bool data_from_file = true;
+ if (target_sp->GetSectionLoadList().ResolveLoadAddress(addr, so_addr))
+ {
+ data_from_file = false;
+ }
+ else
{
if (target_sp->GetSectionLoadList().IsEmpty() || !target_sp->GetImages().ResolveFileAddress(addr, so_addr))
so_addr.SetRawAddress(addr);
}
- size_t bytes_consumed = disassembler_sp->DecodeInstructions (so_addr, *this, start_offset, item_count, false);
+ size_t bytes_consumed = disassembler_sp->DecodeInstructions (so_addr, *this, start_offset, item_count, false, data_from_file);
if (bytes_consumed)
{
OpenPOWER on IntegriCloud