* lib/Automake/Channels.pm (_default_options): Add `backtrace'.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 10 Sep 2002 20:45:58 +0000 (20:45 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 10 Sep 2002 20:45:58 +0000 (20:45 +0000)
(msg): Die with backtrace if requested.
* automake.in: Enable `backtrace' on the `automake' channel.

ChangeLog
automake.in
lib/Automake/Channels.pm

index 21d12ce..9f53422 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2002-09-10  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
+       * lib/Automake/Channels.pm (_default_options): Add `backtrace'.
+       (msg): Die with backtrace if requested.
+       * automake.in: Enable `backtrace' on the `automake' channel.
+
        * automake.in (process_option_list): Mention `Automake' in
        version-mismatch error.
        Suggested by Akim Demaille.
index 981865f..538748e 100755 (executable)
@@ -857,7 +857,7 @@ register_channel 'error-gnu/warn', type => 'error';
 # 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 3136108..13adb6b 100644 (file)
@@ -186,6 +186,10 @@ A string to prepend to each message emitted through this channel.
 
 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 @@ our %_default_options =
    uniq_part => UP_LOC_TEXT,
    header => '',
    footer => '',
+   backtrace => 0,
    );
 
 # Filled with output messages as keys, to detect duplicates.
@@ -468,6 +473,7 @@ sub msg ($$;$%)
        }
 
       # Die on fatal messages.
+      confess if $opts{'backtrace'};
       exit $exit_code if $opts{'type'} eq 'fatal';
     }
 }