diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index 12d5d5242..9e9557f18 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -374,11 +374,11 @@ TEST_F(CrasherTest, heap_addr_in_register) { ConsumeFd(std::move(output_fd), &result); #if defined(__aarch64__) - ASSERT_MATCH(result, "memory near x0"); + ASSERT_MATCH(result, "memory near x0 \\(\\[anon:"); #elif defined(__arm__) - ASSERT_MATCH(result, "memory near r0"); + ASSERT_MATCH(result, "memory near r0 \\(\\[anon:"); #elif defined(__x86_64__) - ASSERT_MATCH(result, "memory near rdi"); + ASSERT_MATCH(result, "memory near rdi \\(\\[anon:"); #else ASSERT_TRUE(false) << "unsupported architecture"; #endif diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp index ca68212b7..4f75ff138 100644 --- a/debuggerd/libdebuggerd/tombstone.cpp +++ b/debuggerd/libdebuggerd/tombstone.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -362,7 +363,7 @@ void dump_memory_and_code(log_t* log, unwindstack::Maps* maps, unwindstack::Memo regs->IterateRegisters([log, maps, memory](const char* reg_name, uint64_t reg_value) { std::string label{"memory near "s + reg_name}; if (maps) { - unwindstack::MapInfo* map_info = maps->Find(reg_value); + unwindstack::MapInfo* map_info = maps->Find(untag_address(reg_value)); if (map_info != nullptr && !map_info->name.empty()) { label += " (" + map_info->name + ")"; } diff --git a/debuggerd/libdebuggerd/tombstone_proto.cpp b/debuggerd/libdebuggerd/tombstone_proto.cpp index bb3c7eae0..23ca070e5 100644 --- a/debuggerd/libdebuggerd/tombstone_proto.cpp +++ b/debuggerd/libdebuggerd/tombstone_proto.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -233,7 +234,7 @@ static void dump_thread(Tombstone* tombstone, unwindstack::Unwinder* unwinder, dump.set_register_name(name); - unwindstack::MapInfo* map_info = maps->Find(value); + unwindstack::MapInfo* map_info = maps->Find(untag_address(value)); if (map_info) { dump.set_mapping_name(map_info->name); }