summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp9
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp8
2 files changed, 14 insertions, 3 deletions
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index 2ba15fe4581..0c07bcb6a50 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -620,9 +620,14 @@ ClangExpressionParser::MakeJIT (lldb::addr_t &func_allocation_addr,
std::map<uint8_t *, uint8_t *>::iterator fun_pos = jit_memory_manager->m_functions.begin();
std::map<uint8_t *, uint8_t *>::iterator fun_end = jit_memory_manager->m_functions.end();
-
+
for (; fun_pos != fun_end; ++fun_pos)
- alloc_size += (*fun_pos).second - (*fun_pos).first;
+ {
+ size_t mem_size = fun_pos->second - fun_pos->first;
+ if (log)
+ log->Printf ("JIT memory: [%p - %p) size = %zu", fun_pos->first, fun_pos->second, mem_size);
+ alloc_size += mem_size;
+ }
Error alloc_error;
func_allocation_addr = exc_context.process->AllocateMemory (alloc_size,
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 172a1cf0f77..95646241427 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1637,7 +1637,13 @@ ProcessGDBRemote::DoAllocateMemory (size_t size, uint32_t permissions, Error &er
if (result == eExecutionCompleted)
{
allocated_addr = return_value_sp->GetScalar().ULongLong();
- m_addr_to_mmap_size[allocated_addr] = size;
+ if (GetAddressByteSize() == 4)
+ {
+ if (allocated_addr == UINT32_MAX)
+ allocated_addr = LLDB_INVALID_ADDRESS;
+ }
+ if (allocated_addr != LLDB_INVALID_ADDRESS)
+ m_addr_to_mmap_size[allocated_addr] = size;
}
}
}
OpenPOWER on IntegriCloud