diff options
author | Tom de Vries <tdevries@suse.de> | 2024-01-04 13:42:45 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-01-04 13:42:45 +0100 |
commit | 2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a (patch) | |
tree | f177244238e9c7af26b0c14e729b4f9317d6b829 /gdb/testsuite/gdb.threads | |
parent | fd67aa1129fd006ad49ed5ecb2b063705211553a (diff) | |
download | binutils-2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a.zip binutils-2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a.tar.gz binutils-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.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/pthread_cond_wait.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/tls.exp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp index ff3097c..b29be9e 100644 --- a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp +++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp @@ -51,7 +51,7 @@ global decimal # # This is a "backtrace break" ("btb"): # -set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} in " +set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} (\\\[PAC\\\] )?in " # One of the threads is blocked on a call to pthread_cond_wait, and # we want to verify that we are able to get a sensible backtrace for diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp index 89f6fb8..91a7f80 100644 --- a/gdb/testsuite/gdb.threads/tls.exp +++ b/gdb/testsuite/gdb.threads/tls.exp @@ -132,7 +132,7 @@ proc check_thread_stack {number spin_threads spin_threads_level} { } send_gdb "where\n" gdb_expect { - -re ".*(\[0-9\]+)\[ \t\]+$hex in spin \\(vp=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" { + -re ".*(\[0-9\]+)\[ \t\]+$hex (\\\[PAC\\\] )?in spin \\(vp=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" { if {[info exists tarr($number)]} { fail "backtrace of thread number $number in spin" } else { |