From 44e356f82e26f9bac8ff38fb037fb4b44221bf5c Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 10 Sep 2002 20:45:57 +0000 Subject: [PATCH] * lib/Automake/Channels.pm (_default_options): Add `backtrace'. (msg): Die with backtrace if requested. * automake.in: Enable `backtrace' on the `automake' channel. --- ChangeLog | 4 ++++ automake.in | 2 +- lib/Automake/Channels.pm | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 21d12ce1..9f53422a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2002-09-10 Alexandre Duret-Lutz + * 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. diff --git a/automake.in b/automake.in index 981865fc..538748e5 100755 --- a/automake.in +++ b/automake.in @@ -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"), diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm index 31361081..13adb6bb 100644 --- a/lib/Automake/Channels.pm +++ b/lib/Automake/Channels.pm @@ -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 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'; } } -- 2.43.5