Blame SOURCES/gdb-6.3-ia64-sigill-20051115.patch

01917d
2005-11-15  Jeff Johnston  <jjohnstn@redhat.com>
01917d
01917d
	* linux-thread-db.c (thread_db_wait): Don't bother continuing if
01917d
	the wait result indicates the program terminated with a signal.
01917d
	* linux-nat.c (linux_nat_wait): For SIGILL and SIGTRAP, don't
01917d
	throw away the event if the user has specified nostop noprint.
01917d
01917d
gdb/testsuite:
01917d
01917d
2005-11-15  Jeff Johnston  <jjohnstn@redhat.com>
01917d
01917d
	* gdb.arch/ia64-sigill.c: New test.
01917d
	* gdb.arch/ia64-sigill.exp: Ditto.
01917d
01917d
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.exp
01917d
===================================================================
01917d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
01917d
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.exp	2011-07-22 19:16:13.000000000 +0200
01917d
@@ -0,0 +1,49 @@
01917d
+#   Copyright 2005 Free Software Foundation, Inc.
01917d
+
01917d
+# This program is free software; you can redistribute it and/or modify
01917d
+# it under the terms of the GNU General Public License as published by
01917d
+# the Free Software Foundation; either version 2 of the License, or
01917d
+# (at your option) any later version.
01917d
+# 
01917d
+# This program is distributed in the hope that it will be useful,
01917d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+# GNU General Public License for more details.
01917d
+# 
01917d
+# You should have received a copy of the GNU General Public License
01917d
+# along with this program; if not, write to the Free Software
01917d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
01917d
+
01917d
+# Please email any bugs, comments, and/or additions to this file to:
01917d
+# bug-gdb@prep.ai.mit.edu
01917d
+
01917d
+# This file was written by Jeff Johnston (jjohnstn@redhat.com)
01917d
+
01917d
+if ![istarget "ia64-*-*"] then {
01917d
+    return
01917d
+}
01917d
+
01917d
+set testfile "ia64-sigill"
01917d
+set srcfile ${testfile}.c
01917d
+set binfile ${objdir}/${subdir}/${testfile}
01917d
+
01917d
+# Deliberately compile with pthreads, even though test is single-threaded.
01917d
+# We want to force gdb thread code to be exercised.
01917d
+if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
01917d
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
01917d
+}
01917d
+
01917d
+if [get_compiler_info ${binfile}] {
01917d
+    return -1
01917d
+}
01917d
+
01917d
+gdb_exit
01917d
+gdb_start
01917d
+gdb_reinitialize_dir $srcdir/$subdir
01917d
+gdb_load ${binfile}
01917d
+
01917d
+# We set up SIGILL nostop, noprint, pass and then run the program.
01917d
+# We expect to just see a normal run.
01917d
+gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill"
01917d
+gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit"
01917d
+ 
01917d
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.c
01917d
===================================================================
01917d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
01917d
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.c	2011-07-22 19:16:13.000000000 +0200
01917d
@@ -0,0 +1,8 @@
01917d
+#include <stdio.h>
01917d
+
01917d
+int main()
01917d
+{
01917d
+  printf ("hello world\n");
01917d
+  return 0;
01917d
+}
01917d
+
01917d
Index: gdb-7.3.50.20110722/gdb/linux-nat.c
01917d
===================================================================
01917d
--- gdb-7.3.50.20110722.orig/gdb/linux-nat.c	2011-07-22 19:15:05.000000000 +0200
01917d
+++ gdb-7.3.50.20110722/gdb/linux-nat.c	2011-07-22 19:16:13.000000000 +0200
01917d
@@ -3733,7 +3733,8 @@ retry:
01917d
      threads can be a bit time-consuming so if we want decent
01917d
      performance with heavily multi-threaded programs, especially when
01917d
      they're using a high frequency timer, we'd better avoid it if we
01917d
-     can.  */
01917d
+     can.  For possible trap signals like SIGTRAP and SIGILL, don't
01917d
+     avoid reporting.  */
01917d
 
01917d
   if (WIFSTOPPED (status))
01917d
     {