* gdb.base/relativedebug.exp: Skip test if gdb,nosignals is set
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / relativedebug.exp
1 # Copyright 2007 Free Software Foundation, Inc.
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 2 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17 if [target_info exists gdb,nosignals] {
18 verbose "Skipping relativedebug.exp because of nosignals."
19 continue
20 }
21
22 if $tracelevel then {
23 strace $tracelevel
24 }
25
26 set testfile relativedebug
27 set srcfile ${testfile}.c
28 set binfile ${objdir}/${subdir}/${testfile}
29 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
30 untested "Couldn't compile test program"
31 return -1
32 }
33
34 # Get things started.
35
36 gdb_exit
37 gdb_start
38 gdb_reinitialize_dir $srcdir/$subdir
39 gdb_load ${binfile}
40
41 runto_main
42
43 # pause () -> SIGALRM -> handler () -> abort ()
44 gdb_test "continue" "Program received signal SIGABRT.*"
45
46 # Backtracing through pause broke if glibc has been prelinked,
47 # because the separate debug files in /usr/lib/debug had different
48 # base addresses.
49
50 # incorrect (#6):
51 # (gdb) bt
52 # #0 0x00325402 in __kernel_vsyscall ()
53 # #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
54 # #2 0x0071a801 in *__GI_abort () at abort.c:88
55 # #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27
56 # #4 <signal handler called>
57 # #5 0x00325402 in __kernel_vsyscall ()
58 # #6 0x0077ebc6 in ?? () from /lib/i686/nosegneg/libc.so.6
59 # #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34
60 # (gdb)
61
62 # correct (#6):
63 # (gdb) bt
64 # #0 0x00b33402 in __kernel_vsyscall ()
65 # #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
66 # #2 0x0071a801 in *__GI_abort () at abort.c:88
67 # #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27
68 # #4 <signal handler called>
69 # #5 0x00b33402 in __kernel_vsyscall ()
70 # #6 0x0077ebc6 in __pause_nocancel () from /lib/i686/nosegneg/libc.so.6
71 # #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34
72 # (gdb)
73
74 gdb_test "bt" \
75 ".*\[^a-zA-Z\]pause\[^a-zA-Z\].*" \
76 "pause found in backtrace"
This page took 0.032563 seconds and 5 git commands to generate.