1 # Copyright
2007-2019 Free Software Foundation
, Inc.
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.
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.
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
/>.
16 # Please email
any bugs
, comments
, and
/or additions to this file to
:
19 # This file is part of the gdb testsuite.
21 # Unwinding of DW_CFA_GNU_negative_offset_extended test
program.
26 if { ![is_x86_like_target
] } then {
27 verbose
"Skipping i386 unwinder tests."
31 set testfile
"i386-gnu-cfi"
32 set srcfilec $
{testfile
}.c
33 set srcfileasm $
{testfile
}-asm.S
34 set binfile
[standard_output_file $
{testfile
}]
36 # some targets have leading underscores
on assembly symbols.
37 set additional_flags
[gdb_target_symbol_prefix_flags
]
39 if { [gdb_compile
"${srcdir}/${subdir}/${srcfilec} ${srcdir}/${subdir}/${srcfileasm}" "${binfile}" executable [list debug $additional_flags]] != "" } {
40 untested
"failed to compile"
48 gdb_reinitialize_dir $srcdir
/$subdir
51 # We should stop in abort
(3).
55 gdb_test_multiple
{} "continue to abort()" {
56 -re
".*Program received signal SIGABRT,.*$gdb_prompt $" {
57 pass
"continue to abort()"
61 # Backtrace would crash before.
64 "main \\(\\) at .*${testfile}.c.*" \
67 # Check we see the inserted `DW_CFA_GNU_negative_offset_extended
' CFI.
68 # We see there the original CFI-stored filename `gate.c'.
71 "gate \\(\[^()\]*\\) at .*gate.c.*" \
72 "shift up to the modified frame"
74 gdb_test_multiple
"info frame" "existence of the CFI inserted register" {
75 -re
"Stack level 3, frame at (0x\[0-9a-f\]+):.*Saved registers:.* ecx at (0x\[0-9a-f\]+),.*" {
76 pass
"existence of the CFI inserted register"
77 if { [string compare $expect_out
(1,string
) $expect_out
(2,string
)] } then {
78 fail
"value of the CFI inserted register"
80 pass
"value of the CFI inserted register"