diff options
author | Yabin Cui <yabinc@google.com> | 2018-02-06 13:42:16 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2018-02-13 17:01:18 -0800 |
commit | 6e75e1b8f560bd3029e22aa9ac04e789e405a007 (patch) | |
tree | e78919944ac234ded3c89ed8903e619d52949a5e /simpleperf/perf_regs.h | |
parent | 3579c4460bbd10f1f1b866859dfa4000774e9962 (diff) | |
download | extras-6e75e1b8f560bd3029e22aa9ac04e789e405a007.tar.gz |
simpleperf: Use cross-arch unwinding.
Enables cross-arch unwinding since the new unwinder supports cross-arch
unwinding.
Also change tests accordingly.
Bug: http://b/73127000
Test: run simpleperf_unit_test.
Change-Id: I3ca3f7a81b40e9f7ea2b39b9fdc951f9e7a6acc7
Diffstat (limited to 'simpleperf/perf_regs.h')
-rw-r--r-- | simpleperf/perf_regs.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/simpleperf/perf_regs.h b/simpleperf/perf_regs.h index 7fbae737..86a12d0c 100644 --- a/simpleperf/perf_regs.h +++ b/simpleperf/perf_regs.h @@ -60,7 +60,6 @@ constexpr ArchType GetBuildArch() { ArchType GetArchType(const std::string& arch); ArchType GetArchForAbi(ArchType machine_arch, int abi); std::string GetArchString(ArchType arch); -bool IsArchTheSame(ArchType arch1, ArchType arch2, bool strict_check); uint64_t GetSupportedRegMask(ArchType arch); std::string GetRegName(size_t regno, ArchType arch); @@ -88,14 +87,17 @@ class ScopedCurrentArch { }; struct RegSet { + ArchType arch; + // For each setting bit in valid_mask, there is a valid reg value in data[]. uint64_t valid_mask; + // Stores reg values. Values for invalid regs are 0. uint64_t data[64]; -}; -RegSet CreateRegSet(int abi, uint64_t valid_mask, const uint64_t* valid_regs); + RegSet(int abi, uint64_t valid_mask, const uint64_t* valid_regs); -bool GetRegValue(const RegSet& regs, size_t regno, uint64_t* value); -bool GetSpRegValue(const RegSet& regs, ArchType arch, uint64_t* value); -bool GetIpRegValue(const RegSet& regs, ArchType arch, uint64_t* value); + bool GetRegValue(size_t regno, uint64_t* value) const; + bool GetSpRegValue(uint64_t* value) const; + bool GetIpRegValue(uint64_t* value) const; +}; #endif // SIMPLE_PERF_PERF_REGS_H_ |