Commit | Line | Data |
---|---|---|
3666a048 | 1 | # Copyright 2007-2021 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 | |
46579ac2 UW |
16 | if [target_info exists gdb,nosignals] { |
17 | verbose "Skipping relativedebug.exp because of nosignals." | |
18 | continue | |
19 | } | |
20 | ||
822bd149 TT |
21 | standard_testfile .c |
22 | ||
818f79f6 | 23 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
84c93cd5 | 24 | untested "failed to compile" |
818f79f6 DJ |
25 | return -1 |
26 | } | |
27 | ||
28 | # Get things started. | |
29 | ||
822bd149 | 30 | clean_restart ${binfile} |
818f79f6 DJ |
31 | |
32 | runto_main | |
33 | ||
42d38f42 YQ |
34 | set test "info sharedlibrary" |
35 | gdb_test_multiple $test $test { | |
36 | -re ".*\(\\*\)\[^\r\n\]*/libc\.so.*$gdb_prompt $" { | |
37 | # Skip the test below if libc doesn't have debug info. | |
38 | unsupported "libc doesn't have debug info" | |
39 | return -1 | |
40 | } | |
41 | -re ".*$gdb_prompt $" { | |
42 | } | |
43 | } | |
44 | ||
818f79f6 DJ |
45 | # pause () -> SIGALRM -> handler () -> abort () |
46 | gdb_test "continue" "Program received signal SIGABRT.*" | |
47 | ||
48 | # Backtracing through pause broke if glibc has been prelinked, | |
49 | # because the separate debug files in /usr/lib/debug had different | |
50 | # base addresses. | |
51 | ||
52 | # incorrect (#6): | |
53 | # (gdb) bt | |
54 | # #0 0x00325402 in __kernel_vsyscall () | |
55 | # #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 | |
56 | # #2 0x0071a801 in *__GI_abort () at abort.c:88 | |
57 | # #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27 | |
58 | # #4 <signal handler called> | |
59 | # #5 0x00325402 in __kernel_vsyscall () | |
60 | # #6 0x0077ebc6 in ?? () from /lib/i686/nosegneg/libc.so.6 | |
61 | # #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34 | |
62 | # (gdb) | |
63 | ||
64 | # correct (#6): | |
65 | # (gdb) bt | |
66 | # #0 0x00b33402 in __kernel_vsyscall () | |
67 | # #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 | |
68 | # #2 0x0071a801 in *__GI_abort () at abort.c:88 | |
69 | # #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27 | |
70 | # #4 <signal handler called> | |
71 | # #5 0x00b33402 in __kernel_vsyscall () | |
72 | # #6 0x0077ebc6 in __pause_nocancel () from /lib/i686/nosegneg/libc.so.6 | |
73 | # #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34 | |
74 | # (gdb) | |
75 | ||
76 | gdb_test "bt" \ | |
77 | ".*\[^a-zA-Z\]pause\[^a-zA-Z\].*" \ | |
78 | "pause found in backtrace" |