diff --git a/libunwindstack/Unwinder.cpp b/libunwindstack/Unwinder.cpp index 94edb1cc8..27262bd5b 100644 --- a/libunwindstack/Unwinder.cpp +++ b/libunwindstack/Unwinder.cpp @@ -61,7 +61,9 @@ void Unwinder::FillInDexFrame() { frame->map_offset = info->offset; frame->map_load_bias = info->load_bias; frame->map_flags = info->flags; - frame->map_name = info->name; + if (resolve_names_) { + frame->map_name = info->name; + } frame->rel_pc = dex_pc - info->start; } else { frame->rel_pc = dex_pc; @@ -96,7 +98,9 @@ void Unwinder::FillInFrame(MapInfo* map_info, Elf* elf, uint64_t rel_pc, uint64_ return; } - frame->map_name = map_info->name; + if (resolve_names_) { + frame->map_name = map_info->name; + } frame->map_offset = map_info->offset; frame->map_start = map_info->start; frame->map_end = map_info->end; diff --git a/libunwindstack/tests/UnwinderTest.cpp b/libunwindstack/tests/UnwinderTest.cpp index e44b225c5..551f46c7b 100644 --- a/libunwindstack/tests/UnwinderTest.cpp +++ b/libunwindstack/tests/UnwinderTest.cpp @@ -221,7 +221,7 @@ TEST_F(UnwinderTest, multiple_frames_dont_resolve_names) { EXPECT_EQ(0x10000U, frame->sp); EXPECT_EQ("", frame->function_name); EXPECT_EQ(0U, frame->function_offset); - EXPECT_EQ("/system/fake/libc.so", frame->map_name); + EXPECT_EQ("", frame->map_name); EXPECT_EQ(0U, frame->map_offset); EXPECT_EQ(0x1000U, frame->map_start); EXPECT_EQ(0x8000U, frame->map_end); @@ -235,7 +235,7 @@ TEST_F(UnwinderTest, multiple_frames_dont_resolve_names) { EXPECT_EQ(0x10010U, frame->sp); EXPECT_EQ("", frame->function_name); EXPECT_EQ(0U, frame->function_offset); - EXPECT_EQ("/system/fake/libc.so", frame->map_name); + EXPECT_EQ("", frame->map_name); EXPECT_EQ(0U, frame->map_offset); EXPECT_EQ(0x1000U, frame->map_start); EXPECT_EQ(0x8000U, frame->map_end); @@ -249,7 +249,7 @@ TEST_F(UnwinderTest, multiple_frames_dont_resolve_names) { EXPECT_EQ(0x10020U, frame->sp); EXPECT_EQ("", frame->function_name); EXPECT_EQ(0U, frame->function_offset); - EXPECT_EQ("/system/fake/libc.so", frame->map_name); + EXPECT_EQ("", frame->map_name); EXPECT_EQ(0U, frame->map_offset); EXPECT_EQ(0x1000U, frame->map_start); EXPECT_EQ(0x8000U, frame->map_end);