[gdb/testsuite] Handle PAC marker
commit2bcfdb758bb18e29cf6c0486c448bf78dbbc0c8a
authorTom de Vries <tdevries@suse.de>
Thu, 4 Jan 2024 12:42:45 +0000 (4 13:42 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 4 Jan 2024 12:42:45 +0000 (4 13:42 +0100)
treef177244238e9c7af26b0c14e729b4f9317d6b829
parentfd67aa1129fd006ad49ed5ecb2b063705211553a
[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
gdb/testsuite/gdb.base/annota1.exp
gdb/testsuite/gdb.cp/exception.exp
gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp
gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
gdb/testsuite/gdb.mi/mi-syn-frame.exp
gdb/testsuite/gdb.threads/pthread_cond_wait.exp
gdb/testsuite/gdb.threads/tls.exp