]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2007-2024 Free Software Foundation, Inc. |
818f79f6 DJ |
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 | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
818f79f6 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
818f79f6 DJ |
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. | |
e22f8b7c | 12 | # |
818f79f6 | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
818f79f6 | 15 | |
f5ef12c3 | 16 | require {!target_info exists gdb,nosignals} libc_has_debug_info |
46579ac2 | 17 | |
822bd149 TT |
18 | standard_testfile .c |
19 | ||
818f79f6 | 20 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
84c93cd5 | 21 | untested "failed to compile" |
818f79f6 DJ |
22 | return -1 |
23 | } | |
24 | ||
25 | # Get things started. | |
26 | ||
822bd149 | 27 | clean_restart ${binfile} |
818f79f6 DJ |
28 | |
29 | runto_main | |
30 | ||
31 | # pause () -> SIGALRM -> handler () -> abort () | |
32 | gdb_test "continue" "Program received signal SIGABRT.*" | |
33 | ||
34 | # Backtracing through pause broke if glibc has been prelinked, | |
35 | # because the separate debug files in /usr/lib/debug had different | |
36 | # base addresses. | |
37 | ||
38 | # incorrect (#6): | |
39 | # (gdb) bt | |
40 | # #0 0x00325402 in __kernel_vsyscall () | |
41 | # #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 | |
42 | # #2 0x0071a801 in *__GI_abort () at abort.c:88 | |
43 | # #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27 | |
44 | # #4 <signal handler called> | |
45 | # #5 0x00325402 in __kernel_vsyscall () | |
46 | # #6 0x0077ebc6 in ?? () from /lib/i686/nosegneg/libc.so.6 | |
47 | # #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34 | |
48 | # (gdb) | |
49 | ||
50 | # correct (#6): | |
51 | # (gdb) bt | |
52 | # #0 0x00b33402 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 0x00b33402 in __kernel_vsyscall () | |
58 | # #6 0x0077ebc6 in __pause_nocancel () from /lib/i686/nosegneg/libc.so.6 | |
59 | # #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34 | |
60 | # (gdb) | |
61 | ||
62 | gdb_test "bt" \ | |
63 | ".*\[^a-zA-Z\]pause\[^a-zA-Z\].*" \ | |
64 | "pause found in backtrace" |