|
When a 32-bit simpleperf runs on x86_64, GetMachineArch() returns ARCH_X86_32.
When it is used to record a 64-bit process, RegSet thinks the arch is
ARCH_X86_32, while the correct one is ARCH_X86_64. This bug makes a check
failure in OfflineUnwinderImpl::UnwindCallChain():
Check failed: (*ips)[0] == ip_reg_value
It is fixed in two ways:
1. Use `uname -m` in GetMachineArch() for 32-bit simpleperf on x86. It
can detect a 64-bit device.
2. Use GetArchForAbi() in RegSet.
Bug: 175162821
Bug: 174400620
Test: run simpleperf_unit_test.
Change-Id: Iab29d5a5e26862d73c7aae15bcc31d1c4044a95e
|