From 886e08657ea9afe9ba6265f5a79f5c9b8cd38636 Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Wed, 12 Feb 2003 01:05:47 +0000 Subject: diagnostic.c (real_abort): New. * diagnostic.c (real_abort): New. (diagnostic_report_diagnostic): Call real_abort on error. * diagnostic.h (diagnostic_abort_on_error): New. (struct diagnostic_context): Add abort_on_error field. * toplev.c (setup_core_dumping): New. (decode_d_option): Handle 'H' case. * doc/invoke.texi (Debugging Options): Document -dH. From-SVN: r62753 --- gcc/diagnostic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/diagnostic.c') diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index a192229..21d78a9 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -81,6 +81,7 @@ static void default_diagnostic_finalizer PARAMS ((diagnostic_context *, static void error_recursion PARAMS ((diagnostic_context *)) ATTRIBUTE_NORETURN; static bool text_specifies_location PARAMS ((text_info *, location_t *)); +static void real_abort PARAMS ((void)) ATTRIBUTE_NORETURN; extern int rtl_dump_and_exit; extern int warnings_are_errors; @@ -1283,6 +1284,8 @@ diagnostic_report_diagnostic (context, diagnostic) output_flush (&context->buffer); } + if (context->abort_on_error && diagnostic->kind <= DK_ERROR) + real_abort(); --context->lock; } @@ -1459,3 +1462,13 @@ warn_deprecated_use (node) warning ("type is deprecated"); } } + +/* Really call the system 'abort'. This has to go right at the end of + this file, so that there are no functions after it that call abort + and get the system abort instead of our macro. */ +#undef abort +static void +real_abort () +{ + abort (); +} -- cgit v1.1