diff options
author | Sean Callanan <scallanan@apple.com> | 2013-06-27 01:42:47 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-06-27 01:42:47 +0000 |
commit | ffae944a3994e9d78d1d1501b1532a728c333308 (patch) | |
tree | 873462d821f03d2b6511eb2f7a902298099677bb /lldb/source/Expression/IRExecutionUnit.cpp | |
parent | aa205c431f619dfdf2ccdd77def37117db6a509f (diff) | |
download | bcm5719-llvm-ffae944a3994e9d78d1d1501b1532a728c333308.tar.gz bcm5719-llvm-ffae944a3994e9d78d1d1501b1532a728c333308.zip |
Fixed IRExecutionUnit so that it looks up addresses
correctly. We have been getting lucky since most
expressions generate only one section (or the first
code section contains all the code), but sometimes
it actually matters.
<rdar://problem/14180236>
llvm-svn: 185054
Diffstat (limited to 'lldb/source/Expression/IRExecutionUnit.cpp')
-rw-r--r-- | lldb/source/Expression/IRExecutionUnit.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index c4ce3388c35..ef8c8da0eda 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -564,6 +564,8 @@ IRExecutionUnit::MemoryManager::deallocateFunctionBody(void *Body) lldb::addr_t IRExecutionUnit::GetRemoteAddressForLocal (lldb::addr_t local_address) { + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); + for (AllocationRecord &record : m_records) { if (local_address >= record.m_host_address && @@ -571,9 +573,22 @@ IRExecutionUnit::GetRemoteAddressForLocal (lldb::addr_t local_address) { if (record.m_process_address == LLDB_INVALID_ADDRESS) return LLDB_INVALID_ADDRESS; + + lldb::addr_t ret = record.m_process_address + (local_address - record.m_host_address); + + if (log) + { + log->Printf("IRExecutionUnit::GetRemoteAddressForLocal() found 0x%" PRIx64 " in [0x%" PRIx64 "..0x%" PRIx64 "], and returned 0x%" PRIx64 " from [0x%" PRIx64 "..0x%" PRIx64 "].", + local_address, + (unsigned long long)record.m_host_address, + (unsigned long long)record.m_host_address + (unsigned long long)record.m_size, + ret, + record.m_process_address, + record.m_process_address + record.m_size); + } + + return ret; } - - return record.m_process_address + (local_address - record.m_host_address); } return LLDB_INVALID_ADDRESS; |