aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Nichols <rknichols@google.com>2023-05-19 17:41:55 +0000
committerJoshua Peraza <jperaza@chromium.org>2023-05-19 17:45:08 +0000
commit8267ac651047c3d44354d6a2e6cd36b506766d03 (patch)
treefe62c78e9d3deaf6fa6ec248e82428213d65d301
parent9f96d5c7b7960cbc67942dc28664753557ed186a (diff)
downloadgoogle-breakpad-8267ac651047c3d44354d6a2e6cd36b506766d03.tar.gz
Fix minidump generation on arm softfp targets.
Test: arm softfp build, crashed program intentionally with kill -4 and observed successful minidump generation. Bug: b/283473162 Change-Id: Id71f92653ced04575ffbb87e309d4139ca34d843 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4545508 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
-rw-r--r--src/client/linux/minidump_writer/linux_ptrace_dumper.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
index 0e58236b..2adc39e1 100644
--- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
@@ -179,6 +179,13 @@ bool LinuxPtraceDumper::ReadRegisters(ThreadInfo* info, pid_t tid) {
return false;
}
+ // When running on arm processors the binary may be built with softfp or
+ // hardfp. If built with softfp we have no hardware registers to read from,
+ // so the following read will always fail. gcc defines __SOFTFP__ macro,
+ // clang13 does not do so. see: https://reviews.llvm.org/D135680.
+ // If you are using clang and the macro is NOT defined, please include the
+ // macro define for applicable targets.
+#if !defined(__SOFTFP__)
#if !(defined(__ANDROID__) && defined(__ARM_EABI__))
// When running an arm build on an arm64 device, attempting to get the
// floating point registers fails. On Android, the floating point registers
@@ -190,6 +197,7 @@ bool LinuxPtraceDumper::ReadRegisters(ThreadInfo* info, pid_t tid) {
return false;
}
#endif // !(defined(__ANDROID__) && defined(__ARM_EABI__))
+#endif // !defined(__SOFTFP__)
return true;
#else // PTRACE_GETREGS
return false;