debuggerd: add the PAC keys to the tombstones.
Hard to get otherwise if you're trying to debug PAC issues.
Bug: http://b/214314197
Test: treehugger
Change-Id: I2e5502809f84579bf287364e59d6e7ff67770919
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp
index b107767..2cf5b18 100644
--- a/debuggerd/debuggerd_test.cpp
+++ b/debuggerd/debuggerd_test.cpp
@@ -173,6 +173,14 @@
*status = response.status;
}
+static bool pac_supported() {
+#if defined(__aarch64__)
+ return getauxval(AT_HWCAP) & HWCAP_PACA;
+#else
+ return false;
+#endif
+}
+
class CrasherTest : public ::testing::Test {
public:
pid_t crasher_pid = -1;
@@ -357,6 +365,12 @@
ASSERT_MATCH(result, R"(tagged_addr_ctrl: 000000000007fff3)"
R"( \(PR_TAGGED_ADDR_ENABLE, PR_MTE_TCF_SYNC, mask 0xfffe\))");
}
+
+ if (pac_supported()) {
+ // Test that the default PAC_ENABLED_KEYS value is set.
+ ASSERT_MATCH(result, R"(pac_enabled_keys: 000000000000000f)"
+ R"( \(PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY\))");
+ }
}
TEST_F(CrasherTest, tagged_fault_addr) {