Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / aarch64-pauth.exp
CommitLineData
b811d2c2 1# Copyright (C) 2019-2020 Free Software Foundation, Inc.
8fca4da0
AH
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16# Test a binary with address signing works regardless of whether the target
17# supports pauth instructions. On non pauth systems, all pauth instructions
18# are treated as nops.
19
20if {![is_aarch64_target]} {
21 verbose "Skipping ${gdb_test_file_name}."
22 return
23}
24
25# Build program with address signing forced on.
26standard_testfile
27set compile_flags {debug}
28lappend compile_flags "additional_flags=-msign-return-address=all"
29lappend compile_flags "additional_flags=-fno-inline"
30if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${compile_flags}] } {
31 return -1
32}
33
34if ![runto_main] {
35 untested "could not run to main"
36 return -1
37}
38
39gdb_breakpoint [ gdb_get_line_number "break here" ]
40gdb_continue_to_breakpoint "break here" ".*break here.*"
41
42# Ensure we can get a full backtrace, despite the address signing.
43gdb_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"
This page took 0.117215 seconds and 4 git commands to generate.