diff options
author | Josh Gao <jmgao@google.com> | 2017-08-25 13:55:06 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-08-25 14:48:09 -0700 |
commit | 0953ecd03a90350117d6881c55959c6644972b79 (patch) | |
tree | 5bfbfde939a83d68e8769f58eefda0c4f3d61380 /libunwindstack/tests/UnwindTest.cpp | |
parent | 46244a6497ac6b0b1a589e40a67d0f99f462ba1e (diff) |
libunwindstack: make machine type a property of Regs.
There are no actual users of the machine type output parameter to
Regs::RemoteGet. The concrete implementations of Regs know what machine
type they represent anyway, so provide an accessor to query.
Test: treehugger
Test: libunwindstack tests on 32/64-bit host, hikey960
Change-Id: Ia25910531d36c41b2b6919f154cfa914aae63117
Diffstat (limited to 'libunwindstack/tests/UnwindTest.cpp')
-rw-r--r-- | libunwindstack/tests/UnwindTest.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libunwindstack/tests/UnwindTest.cpp b/libunwindstack/tests/UnwindTest.cpp index 3c69e2a49..2fc3a3880 100644 --- a/libunwindstack/tests/UnwindTest.cpp +++ b/libunwindstack/tests/UnwindTest.cpp @@ -206,8 +206,7 @@ TEST(UnwindTest, remote) { RemoteMaps maps(pid); ASSERT_TRUE(maps.Parse()); MemoryRemote memory(pid); - uint32_t machine_type; - std::unique_ptr<Regs> regs(Regs::RemoteGet(pid, &machine_type)); + std::unique_ptr<Regs> regs(Regs::RemoteGet(pid)); ASSERT_TRUE(regs.get() != nullptr); VerifyUnwind(pid, &memory, &maps, regs.get(), kFunctionOrder); @@ -254,7 +253,7 @@ TEST(UnwindTest, from_context) { LocalMaps maps; ASSERT_TRUE(maps.Parse()); - std::unique_ptr<Regs> regs(Regs::CreateFromUcontext(Regs::GetMachineType(), ucontext)); + std::unique_ptr<Regs> regs(Regs::CreateFromUcontext(Regs::CurrentMachineType(), ucontext)); MemoryLocal memory; VerifyUnwind(tid.load(), &memory, &maps, regs.get(), kFunctionOrder); @@ -293,8 +292,7 @@ static void RemoteThroughSignal(unsigned int sa_flags) { RemoteMaps maps(pid); ASSERT_TRUE(maps.Parse()); MemoryRemote memory(pid); - uint32_t machine_type; - std::unique_ptr<Regs> regs(Regs::RemoteGet(pid, &machine_type)); + std::unique_ptr<Regs> regs(Regs::RemoteGet(pid)); ASSERT_TRUE(regs.get() != nullptr); VerifyUnwind(pid, &memory, &maps, regs.get(), kFunctionSignalOrder); |