From 02a6c448c32c37aae834bc25e92db97bfac32524 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 11 Mar 2019 14:43:33 -0700 Subject: Add support for displaying soname in an apk. Changes: - Change GetSoname to always returns a std::string. - Added new unit tests for the soname printing. - Modify the GetElf() function to save the same elf when we see rosegment linkers that split the read-only and read-write across a map. This avoids creating multiple elf objects for each map. - Fixed a few offline unwind tests. Bug: 29218999 Test: Unit tests pass. Change-Id: Iad7c38b5c2957a8c5fd4ba94ebec335bafcad57d --- libunwindstack/tests/ElfTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libunwindstack/tests/ElfTest.cpp') diff --git a/libunwindstack/tests/ElfTest.cpp b/libunwindstack/tests/ElfTest.cpp index 1ff23064f..23c9cf860 100644 --- a/libunwindstack/tests/ElfTest.cpp +++ b/libunwindstack/tests/ElfTest.cpp @@ -126,9 +126,9 @@ TEST_F(ElfTest, elf_invalid) { ASSERT_FALSE(elf.valid()); ASSERT_TRUE(elf.interface() == nullptr); - std::string name; - ASSERT_FALSE(elf.GetSoname(&name)); + ASSERT_EQ("", elf.GetSoname()); + std::string name; uint64_t func_offset; ASSERT_FALSE(elf.GetFunctionName(0, &name, &func_offset)); @@ -309,7 +309,7 @@ class ElfInterfaceMock : public ElfInterface { bool Init(uint64_t*) override { return false; } void InitHeaders(uint64_t) override {} - bool GetSoname(std::string*) override { return false; } + std::string GetSoname() override { return ""; } bool GetFunctionName(uint64_t, std::string*, uint64_t*) override { return false; } std::string GetBuildID() override { return ""; } -- cgit v1.2.3