summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2018-12-21 10:27:46 +0000
committer David Srbecky <dsrbecky@google.com> 2018-12-21 15:41:19 +0000
commit9383d692bc6ad206d0232f1d68f9c41585a2665c (patch)
treeaef0ba1c52f9dd867e6b2adf2356b9ed1bad9073
parentfadea6bfadc3dccb8d28eb6a133fb8f27e2c4ec2 (diff)
Allow multiple native debug entries with same address.
We create packed entries which hold multiple methods and have address aligned to 64k block that contains those methods. If there is no method at the start of the block, it is possible the new method will be JITed at that 64k-aligned address. Test: test.py -b -r -t 137 Bug: 121363337 Change-Id: I2561b207f99e91e03f4709df5f318879c884a829
-rw-r--r--runtime/jit/debugger_interface.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/jit/debugger_interface.cc b/runtime/jit/debugger_interface.cc
index 7aa6ddfb00..99f9387c9e 100644
--- a/runtime/jit/debugger_interface.cc
+++ b/runtime/jit/debugger_interface.cc
@@ -274,7 +274,7 @@ void RemoveNativeDebugInfoForDex(Thread* self, const DexFile* dexfile) {
}
// Mapping from handle to entry. Used to manage life-time of the entries.
-static std::map<const void*, JITCodeEntry*> g_jit_debug_entries GUARDED_BY(g_jit_debug_lock);
+static std::multimap<const void*, JITCodeEntry*> g_jit_debug_entries GUARDED_BY(g_jit_debug_lock);
// Number of entries added since last packing. Used to pack entries in bulk.
static size_t g_jit_num_unpacked_entries GUARDED_BY(g_jit_debug_lock) = 0;
@@ -383,8 +383,7 @@ void AddNativeDebugInfoForJit(Thread* self,
// (this only happens when --generate-debug-info flag is enabled for the purpose
// of being debugged with gdb; it does not happen for debuggable apps by default).
if (code_ptr != nullptr) {
- bool ok = g_jit_debug_entries.emplace(code_ptr, entry).second;
- DCHECK(ok) << "Native debug entry already exists for " << std::hex << code_ptr;
+ g_jit_debug_entries.emplace(code_ptr, entry);
// Count how many entries we have added since the last mini-debug-info packing.
// We avoid g_jit_debug_entries.size() here because it can shrink during packing.
g_jit_num_unpacked_entries++;