OSDN Git Service

Redefine abort to report linenumber and filename of the error
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Apr 1998 08:49:53 +0000 (08:49 +0000)
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Apr 1998 08:49:53 +0000 (08:49 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19423 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/.gdbinit
gcc/ChangeLog
gcc/system.h

index dea758b..fe4592b 100644 (file)
@@ -90,6 +90,11 @@ end
 # stdio stop working and therefore the `pr' command below as well.
 b abort
 
+# Put breakpoints at exit and fancy_abort in case abort is mapped
+# to either fprintf/exit or fancy_abort.
+b exit
+b fancy_abort
+
 # Make gdb complain about symbol reading errors.  This is so that gcc
 # developers can see and fix bugs in gcc debug output.
 set complaints 20
index 77848d6..23e212d 100644 (file)
@@ -1,5 +1,11 @@
 Mon Apr 27 08:55:23 1998  Michael Meissner  <meissner@cygnus.com>
 
+       * system.h (abort): If abort is not defined, and neither is
+       USE_SYSTEM_ABORT, redefine abort to call fprintf and exit,
+       reporting the line and filename of the error.
+
+       * .gdbinit: Add breakpoints on exit and fancy_abort.
+
        * final.c (split_double): Avoid a compiler warning if
        BITS_PER_WORD is less than or equal to HOST_BIT_PER_WIDE_INT.
 
index 6e8548e..e381c2d 100644 (file)
@@ -188,4 +188,33 @@ extern void free ();
 extern char *getenv ();
 #endif
 
+/* Redefine abort to report an internal error w/o coredump, and reporting the
+   location of the error in the source file.  */
+#ifndef abort
+#ifndef __STDC__
+#ifndef __GNUC__
+#ifndef USE_SYSTEM_ABORT
+#define USE_SYSTEM_ABORT
+#endif /* !USE_SYSTEM_ABORT */
+#endif /* !__GNUC__ */
+#endif /* !__STDC__ */
+
+#ifndef USE_SYSTEM_ABORT
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#define abort()                                                                \
+(fprintf (stderr,                                                      \
+         "%s:%d: Internal compiler error\n", __FILE__, __LINE__),      \
+ exit (FATAL_EXIT_CODE))
+
+#else
+#define abort()                                                                \
+(fprintf (stderr,                                                      \
+         "%s:%d: Internal compiler error in function %s\n",            \
+         __FILE__, __LINE__, __PRETTY_FUNCTION__),                     \
+ exit (FATAL_EXIT_CODE))
+
+#endif /* recent gcc */
+#endif /* !USE_SYSTEM_ABORT */
+#endif /* !abort */
+
 #endif /* __GCC_SYSTEM_H__ */