summaryrefslogtreecommitdiff
path: root/debuggerd/crash_dump.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2020-09-14 20:27:36 -0700
committerPeter Collingbourne <pcc@google.com>2020-09-15 21:32:36 -0700
commit864f15dd6d05abe77670e2e20fe7aa1819600e7c (patch)
treedd37358a2568729acacd33b6d279eb9466207e74 /debuggerd/crash_dump.cpp
parent278f11b57425d3a14369049e866c597980677988 (diff)
Dump the per-thread TAGGED_ADDR_CTRL value if available.
This value indicates whether memory tagging is enabled on a thread, the mode (sync or async) and the set of excluded tags. This information can sometimes be important for understanding an MTE related crash, so include it in the per-thread tombstone output. Bug: 135772972 Change-Id: I25a16e10ac7fbb2b1ab2a961a5279f787039000b
Diffstat (limited to 'debuggerd/crash_dump.cpp')
-rw-r--r--debuggerd/crash_dump.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/debuggerd/crash_dump.cpp b/debuggerd/crash_dump.cpp
index d7cb9725f..c52c6f741 100644
--- a/debuggerd/crash_dump.cpp
+++ b/debuggerd/crash_dump.cpp
@@ -40,6 +40,7 @@
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
+#include <bionic/mte_kernel.h>
#include <bionic/reserved_signals.h>
#include <cutils/sockets.h>
#include <log/log.h>
@@ -486,6 +487,17 @@ int main(int argc, char** argv) {
continue;
}
+#ifdef ANDROID_EXPERIMENTAL_MTE
+ struct iovec iov = {
+ &info.tagged_addr_ctrl,
+ sizeof(info.tagged_addr_ctrl),
+ };
+ if (ptrace(PTRACE_GETREGSET, thread, NT_ARM_TAGGED_ADDR_CTRL,
+ reinterpret_cast<void*>(&iov)) == -1) {
+ info.tagged_addr_ctrl = -1;
+ }
+#endif
+
if (thread == g_target_thread) {
// Read the thread's registers along with the rest of the crash info out of the pipe.
ReadCrashInfo(input_pipe, &siginfo, &info.registers, &process_info);