]>
Commit | Line | Data |
---|---|---|
3a58abaf AM |
1 | 2005-11-15 Jeff Johnston <jjohnstn@redhat.com> |
2 | ||
3 | * linux-thread-db.c (thread_db_wait): Don't bother continuing if | |
4 | the wait result indicates the program terminated with a signal. | |
5 | * linux-nat.c (linux_nat_wait): For SIGILL and SIGTRAP, don't | |
6 | throw away the event if the user has specified nostop noprint. | |
7 | ||
8 | gdb/testsuite: | |
9 | ||
10 | 2005-11-15 Jeff Johnston <jjohnstn@redhat.com> | |
11 | ||
12 | * gdb.arch/ia64-sigill.c: New test. | |
13 | * gdb.arch/ia64-sigill.exp: Ditto. | |
14 | ||
15 | Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp | |
16 | =================================================================== | |
17 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
18 | +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp 2008-12-02 21:10:57.000000000 +0100 | |
19 | @@ -0,0 +1,59 @@ | |
20 | +# Copyright 2005 Free Software Foundation, Inc. | |
21 | + | |
22 | +# This program is free software; you can redistribute it and/or modify | |
23 | +# it under the terms of the GNU General Public License as published by | |
24 | +# the Free Software Foundation; either version 2 of the License, or | |
25 | +# (at your option) any later version. | |
26 | +# | |
27 | +# This program is distributed in the hope that it will be useful, | |
28 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
29 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
30 | +# GNU General Public License for more details. | |
31 | +# | |
32 | +# You should have received a copy of the GNU General Public License | |
33 | +# along with this program; if not, write to the Free Software | |
34 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
35 | + | |
36 | +# Please email any bugs, comments, and/or additions to this file to: | |
37 | +# bug-gdb@prep.ai.mit.edu | |
38 | + | |
39 | +# This file was written by Jeff Johnston (jjohnstn@redhat.com) | |
40 | + | |
41 | +if $tracelevel then { | |
42 | + strace $tracelevel | |
43 | +} | |
44 | + | |
45 | +# | |
46 | +# test running programs | |
47 | +# | |
48 | +set prms_id 0 | |
49 | +set bug_id 0 | |
50 | + | |
51 | +if ![istarget "ia64-*-*"] then { | |
52 | + return | |
53 | +} | |
54 | + | |
55 | +set testfile "ia64-sigill" | |
56 | +set srcfile ${testfile}.c | |
57 | +set binfile ${objdir}/${subdir}/${testfile} | |
58 | + | |
59 | +# Deliberately compile with pthreads, even though test is single-threaded. | |
60 | +# We want to force gdb thread code to be exercised. | |
61 | +if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } { | |
62 | + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." | |
63 | +} | |
64 | + | |
65 | +if [get_compiler_info ${binfile}] { | |
66 | + return -1 | |
67 | +} | |
68 | + | |
69 | +gdb_exit | |
70 | +gdb_start | |
71 | +gdb_reinitialize_dir $srcdir/$subdir | |
72 | +gdb_load ${binfile} | |
73 | + | |
74 | +# We set up SIGILL nostop, noprint, pass and then run the program. | |
75 | +# We expect to just see a normal run. | |
76 | +gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill" | |
77 | +gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit" | |
78 | + | |
79 | Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c | |
80 | =================================================================== | |
81 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
82 | +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c 2008-12-02 21:10:57.000000000 +0100 | |
83 | @@ -0,0 +1,8 @@ | |
84 | +#include <stdio.h> | |
85 | + | |
86 | +int main() | |
87 | +{ | |
88 | + printf ("hello world\n"); | |
89 | + return 0; | |
90 | +} | |
91 | + | |
92 | Index: gdb-6.8.50.20081128/gdb/linux-nat.c | |
93 | =================================================================== | |
94 | --- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-02 19:04:38.000000000 +0100 | |
95 | +++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 21:11:11.000000000 +0100 | |
96 | @@ -2974,7 +2974,8 @@ retry: | |
97 | threads can be a bit time-consuming so if we want decent | |
98 | performance with heavily multi-threaded programs, especially when | |
99 | they're using a high frequency timer, we'd better avoid it if we | |
100 | - can. */ | |
101 | + can. For possible trap signals like SIGTRAP and SIGILL, don't | |
102 | + avoid reporting. */ | |
103 | ||
104 | if (WIFSTOPPED (status)) | |
105 | { | |
106 | @@ -2992,7 +2993,9 @@ retry: | |
107 | && inf->stop_soon == NO_STOP_QUIETLY | |
108 | && signal_stop_state (signo) == 0 | |
109 | && signal_print_state (signo) == 0 | |
110 | - && signal_pass_state (signo) == 1) | |
111 | + && signal_pass_state (signo) == 1 | |
112 | + && signo != TARGET_SIGNAL_ILL | |
113 | + && signo != TARGET_SIGNAL_TRAP) | |
114 | { | |
115 | /* FIMXE: kettenis/2001-06-06: Should we resume all threads | |
116 | here? It is not clear we should. GDB may not expect |