Harden gdb.arch/aarch64-pauth.exp and fix a failure
authorLuis Machado <luis.machado@linaro.org>
Fri, 21 Feb 2020 20:58:48 +0000 (17:58 -0300)
committerLuis Machado <luis.machado@linaro.org>
Fri, 28 Feb 2020 10:27:14 +0000 (07:27 -0300)
When running this testcase against a QEMU with PAC support, i noticed we
were failing to recognize the additional [PAC] that is emitted in the
backtrace, resulting in this failure:

FAIL: gdb.arch/aarch64-pauth.exp: backtrace

I've made the test use multi_line to make the pattern more clear.

Tested against aarch64-linux-gnu with and without PAC support.

gdb/testsuite/ChangeLog:

2020-02-28  Luis Machado  <luis.machado@linaro.org>

* gdb.arch/aarch64-pauth.exp: Recognize optional PAC output.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/aarch64-pauth.exp

index d5798bd394ccac152e735d8af1d54faff47268b4..eb81976f26cbc8ed43f14aea0582835d2c8ed00f 100644 (file)
@@ -1,3 +1,7 @@
+2020-02-28  Luis Machado  <luis.machado@linaro.org>
+
+       * gdb.arch/aarch64-pauth.exp: Recognize optional PAC output.
+
 2020-02-27  Tom de Vries  <tdevries@suse.de>
 
        * config/sid.exp: Remove unused globals.
index 816e58be4409dda6e4adf3cdc0ea586e82d7959e..264bfce020560294cf3905a00f3505371ecc0004 100644 (file)
@@ -40,4 +40,9 @@ gdb_breakpoint [ gdb_get_line_number "break here" ]
 gdb_continue_to_breakpoint "break here" ".*break here.*"
 
 # Ensure we can get a full backtrace, despite the address signing.
-gdb_test "bt" "^bt\r\n#0 +bar *\\(b=9\\) +at.*\r\n#1 +0x\[0-9a-f\]* +in +foo \\(a=5\\).*\r\n#2 +0x\[0-9a-f\]* +in +main \\(\\).*" "backtrace"
+gdb_test "bt" \
+    [multi_line \
+       "#0\[ \t\]+bar \\(b=9\\) at \[^\r\n\]+" \
+       "#1\[ \t\]+$hex (\\\[PAC\\\] )?in foo \\(a=5\\) at \[^\r\n\]+" \
+       "#2\[ \t\]+$hex (\\\[PAC\\\] )?in main \\(\\) at \[^\r\n\]+" ] \
+    "backtrace"
This page took 0.031712 seconds and 4 git commands to generate.