1 2005-11-15 Jeff Johnston <jjohnstn@redhat.com>
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.
10 2005-11-15 Jeff Johnston <jjohnstn@redhat.com>
12 * gdb.arch/ia64-sigill.c: New test.
13 * gdb.arch/ia64-sigill.exp: Ditto.
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
20 +# Copyright 2005 Free Software Foundation, Inc.
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.
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.
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.
36 +# Please email any bugs, comments, and/or additions to this file to:
37 +# bug-gdb@prep.ai.mit.edu
39 +# This file was written by Jeff Johnston (jjohnstn@redhat.com)
41 +if $tracelevel then {
46 +# test running programs
51 +if ![istarget "ia64-*-*"] then {
55 +set testfile "ia64-sigill"
56 +set srcfile ${testfile}.c
57 +set binfile ${objdir}/${subdir}/${testfile}
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."
65 +if [get_compiler_info ${binfile}] {
71 +gdb_reinitialize_dir $srcdir/$subdir
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"
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
88 + printf ("hello world\n");
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
101 + can. For possible trap signals like SIGTRAP and SIGILL, don't
102 + avoid reporting. */
104 if (WIFSTOPPED (status))
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)
115 /* FIMXE: kettenis/2001-06-06: Should we resume all threads
116 here? It is not clear we should. GDB may not expect