automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: backtraces on internal errors


From: Alexandre Duret-Lutz
Subject: FYI: backtraces on internal errors
Date: 10 Sep 2002 22:23:42 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

I'm checking this in.  Now Automake prints a stack backtrace
when &prog_error is called.

2002-09-10  Alexandre Duret-Lutz  <address@hidden>

        * lib/Automake/Channels.pm (_default_options): Add `backtrace'.
        (msg): Die with backtrace if requested.
        * automake.in: Enable `backtrace' on the `automake' channel.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1346
diff -u -r1.1346 automake.in
--- automake.in 10 Sep 2002 13:55:30 -0000      1.1346
+++ automake.in 10 Sep 2002 20:40:19 -0000
@@ -857,7 +857,7 @@
 # Errors related to GNITS Standards (silent by default).
 register_channel 'error-gnits', type => 'error', silent => 1;
 # Internal errors.
-register_channel 'automake', type => 'fatal',
+register_channel 'automake', type => 'fatal', backtrace => 1,
   header => ("####################\n" .
             "## Internal Error ##\n" .
             "####################\n"),
Index: lib/Automake/Channels.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Channels.pm,v
retrieving revision 1.3
diff -u -r1.3 Channels.pm
--- lib/Automake/Channels.pm    23 Aug 2002 12:24:48 -0000      1.3
+++ lib/Automake/Channels.pm    10 Sep 2002 20:40:20 -0000
@@ -186,6 +186,10 @@
 
 A string to append to each message emitted through this channel.
 
+=item C<backtrace =E<gt> 0>
+
+Die with a stack backtrace after displaying the message.
+
 =back
 
 =cut
@@ -201,6 +205,7 @@
    uniq_part => UP_LOC_TEXT,
    header => '',
    footer => '',
+   backtrace => 0,
    );
 
 # Filled with output messages as keys, to detect duplicates.
@@ -468,6 +473,7 @@
        }
 
       # Die on fatal messages.
+      confess if $opts{'backtrace'};
       exit $exit_code if $opts{'type'} eq 'fatal';
     }
 }

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]