This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Support -dH when running out of stack space on Darwin


This helped me a lot when debugging the insn-recog.c problem of my
previous patch.

Tested on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwinstackoverflowdH.patch===========
2003-04-29  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/host-darwin.c (segv_handler): When -dH is used,
	call abort() after running out of stack space.

Index: config/rs6000/host-darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/host-darwin.c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 host-darwin.c
--- config/rs6000/host-darwin.c	13 Apr 2003 17:51:06 -0000	1.3
+++ config/rs6000/host-darwin.c	30 Apr 2003 01:45:43 -0000
@@ -26,6 +26,7 @@
 #include "hosthooks.h"
 #include "hosthooks-def.h"
 #include "toplev.h"
+#include "diagnostic.h"
 
 static void segv_crash_handler PARAMS ((int));
 static void segv_handler PARAMS ((int, siginfo_t *, void *));
@@ -105,6 +106,9 @@ segv_handler (sig, sip, scp)
 	      }
 	}
       
+      if (global_dc->abort_on_error)
+	abort ();
+
       exit (FATAL_EXIT_CODE);
     }
 
Index: config/rs6000/x-darwin
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/x-darwin,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 x-darwin
--- config/rs6000/x-darwin	6 Feb 2003 01:47:56 -0000	1.4
+++ config/rs6000/x-darwin	30 Apr 2003 01:45:43 -0000
@@ -1,4 +1,4 @@
 host-darwin.o : $(srcdir)/config/rs6000/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \
-  coretypes.h hosthooks.h hosthooks-def.h toplev.h
+  coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 		$(srcdir)/config/rs6000/host-darwin.c
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]