summaryrefslogtreecommitdiff
path: root/simpleperf/dwarf_unwind.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-11-16 12:26:13 -0800
committerYabin Cui <yabinc@google.com>2016-11-16 18:46:39 -0800
commit417df291499b37f63fa9b930e081d80a25bf38ec (patch)
tree90f118e851739c0ba6a36103c99cd693be886166 /simpleperf/dwarf_unwind.cpp
parent960a81aaeb33f39bc8afc31c144686832f8e1dda (diff)
downloadextras-417df291499b37f63fa9b930e081d80a25bf38ec.tar.gz
simpleperf: fix dumping arm regs on arm64 devices.
On arm64 devices, the kernel dumps arm64 regs even for 32-bit processes. So we need to map from arm64 registers to arm registers. Bug: http://b/30974693 Test: run simpleperf manually on one app. Change-Id: Iffeac9510b418b5dabc0604c16523887d63bba49
Diffstat (limited to 'simpleperf/dwarf_unwind.cpp')
-rw-r--r--simpleperf/dwarf_unwind.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/simpleperf/dwarf_unwind.cpp b/simpleperf/dwarf_unwind.cpp
index 5444ef97..5f437c36 100644
--- a/simpleperf/dwarf_unwind.cpp
+++ b/simpleperf/dwarf_unwind.cpp
@@ -94,10 +94,13 @@ static ucontext_t BuildUContextFromRegs(const RegSet& regs __attribute__((unused
return ucontext;
}
-std::vector<uint64_t> UnwindCallChain(ArchType arch, const ThreadEntry& thread,
+std::vector<uint64_t> UnwindCallChain(int abi, const ThreadEntry& thread,
const RegSet& regs, const char* stack,
size_t stack_size, bool strict_arch_check) {
std::vector<uint64_t> result;
+ ArchType arch = (abi != PERF_SAMPLE_REGS_ABI_32) ?
+ ScopedCurrentArch::GetCurrentArch() :
+ ScopedCurrentArch::GetCurrentArch32();
if (!IsArchTheSame(arch, GetBuildArch(), strict_arch_check)) {
LOG(FATAL) << "simpleperf is built in arch " << GetArchString(GetBuildArch())
<< ", and can't do stack unwinding for arch " << GetArchString(arch);