aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/annota1.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-01-04 13:42:45 +0100
committerTom de Vries <tdevries@suse.de>2024-01-04 13:42:45 +0100
commit2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a (patch)
treef177244238e9c7af26b0c14e729b4f9317d6b829 /gdb/testsuite/gdb.base/annota1.exp
parentfd67aa1129fd006ad49ed5ecb2b063705211553a (diff)
downloadgdb-2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a.zip
gdb-2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a.tar.gz
gdb-2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a.tar.bz2
[gdb/testsuite] Handle PAC marker
On aarch64-linux, I run into: ... FAIL: gdb.base/annota1.exp: backtrace from shlibrary (timeout) ... due to the PAC marker showing up: ... ^Z^Zframe-address^M 0x000000000041025c [PAC]^M ^Z^Zframe-address-end^M ... In the docs the marker is documented as follows: ... When GDB is debugging the AArch64 architecture, and the program is using the v8.3-A feature Pointer Authentication (PAC), then whenever the link register $lr is pointing to an PAC function its value will be masked. When GDB prints a backtrace, any addresses that required unmasking will be postfixed with the marker [PAC]. When using the MI, this is printed as part of the addr_flags field. ... Update the test-case to allow the PAC marker. Likewise in a few other test-cases. While we're at it, rewrite the affected pattern pat_begin in annota1.exp into a more readable form. Likewise for the corresponding pat_end. Tested on aarch64-linux. Approved-By: Luis Machado <luis.machado@arm.com> PR testsuite/31202 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31202
Diffstat (limited to 'gdb/testsuite/gdb.base/annota1.exp')
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp47
1 files changed, 45 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 90c03d0..c38c355 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -284,9 +284,52 @@ gdb_test_multiple "continue" "continue to printf" {
# annotate-frame-address
# annotate-frame-address-end
#
-set pat_begin "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\n.*printf(@.*)?\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n"
+set pat_begin \
+ [list \
+ "\r\n\032\032post-prompt\r\n" \
+ "\r\n\032\032frame-begin 0 $hex\r\n" \
+ ".0 \r\n" \
+ "(" \
+ "\032\032frame-address\r\n" \
+ "${hex}( \\\[PAC\\\])?" \
+ "\r\n\032\032frame-address-end\r\n" \
+ " in \r\n" \
+ ")*" \
+ "\032\032frame-function-name\r\n" \
+ ".*printf(@.*)?" \
+ "\r\n\032\032frame-args\r\n" \
+ " \\(.*frame-end\r\n" \
+ "\r\n\032\032frame-begin 1 $hex\r\n" \
+ ".1 " \
+ "\r\n\032\032frame-address\r\n" \
+ "${hex}( \\\[PAC\\\])?" \
+ "\r\n\032\032frame-address-end\r\n" \
+ " in " \
+ "\r\n\032\032frame-function-name\r\n" \
+ "main" \
+ "\r\n\032\032frame-args\r\n" \
+ " \\(\\)" \
+ "\r\n\032\032frame-source-begin\r\n" \
+ " at " \
+ "\r\n\032\032frame-source-file\r\n"]
+
+set pat_begin [join $pat_begin ""]
+
+set pat_end \
+ [list \
+ "\r\n\032\032frame-source-file-end\r\n" \
+ ":" \
+ "\r\n\032\032frame-source-line\r\n" \
+ ".*" \
+ "\r\n\032\032frame-source-end\r\n\r\n" \
+ "\r\n\032\032frame-end\r\n" \
+ "(" \
+ "\r\n\032\032frame-begin .*\r\n" \
+ "\r\n\032\032frame-end\r\n" \
+ ")*" \
+ "$gdb_prompt$"]
-set pat_end "\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$"
+set pat_end [join $pat_end ""]
gdb_test_multiple "backtrace" "backtrace from shlibrary" {
-re "$pat_begin$escapedsrcfile$pat_end" {