aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/main/hipe.hrl.src
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-11-19 14:26:01 +0100
committerMagnus Lång <[email protected]>2016-11-19 16:13:36 +0100
commite7250092945c7d15063d7b2f8ab50070b2a30786 (patch)
tree9ffa2dce8d3786405d0d54a6749bffccb8aef8b7 /lib/hipe/main/hipe.hrl.src
parent4683b5c227a238ee27f658bdfe2981c4b69acf09 (diff)
downloadotp-e7250092945c7d15063d7b2f8ab50070b2a30786.tar.gz
otp-e7250092945c7d15063d7b2f8ab50070b2a30786.tar.bz2
otp-e7250092945c7d15063d7b2f8ab50070b2a30786.zip
hipe: Improve error message on internal crashes
Print the MFA/module being compiled, and pretty-print the backtrace with lib:format_stacktrace/4. Additionally, make the error_msg/2 macro in hipe.hrl respect the HIPE_LOGGING define, since messages produced by this macro just before runtime shutdown were sometimes lost (since code_server:error_msg/2 is asynchronous).
Diffstat (limited to 'lib/hipe/main/hipe.hrl.src')
-rw-r--r--lib/hipe/main/hipe.hrl.src10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/hipe/main/hipe.hrl.src b/lib/hipe/main/hipe.hrl.src
index 53b59f88f0..08bfd17f30 100644
--- a/lib/hipe/main/hipe.hrl.src
+++ b/lib/hipe/main/hipe.hrl.src
@@ -1,4 +1,4 @@
-%% -*- erlang-indent-level: 2 -*-
+%% -*- mode: erlang; erlang-indent-level: 2 -*-
%%
%% %CopyrightBegin%
%%
@@ -70,20 +70,24 @@
code_server:info_msg(?MSGTAG ++ Msg, Args)).
-define(untagged_msg(Msg, Args),
code_server:info_msg(Msg, Args)).
+-define(untagged_error_msg(Msg, Args),
+ code_server:error_msg(Msg, Args)).
-else.
-define(msg(Msg, Args),
io:format(?MSGTAG ++ Msg, Args)).
-define(untagged_msg(Msg, Args),
io:format(Msg, Args)).
+-define(untagged_error_msg(Msg, Args),
+ io:format(Msg, Args)).
-endif.
%%
%% Define error and warning messages.
%%
-define(error_msg(Msg, Args),
- code_server:error_msg(?MSGTAG ++
+ ?untagged_error_msg(?MSGTAG ++
"Error: [~s:~w]: " ++ Msg,
- [?MODULE,?LINE|Args])).
+ [?MODULE,?LINE|Args])).
-define(WARNING_MSG(Msg, Args),
?msg("Warning: [~s:~w]: " ++ Msg, [?MODULE,?LINE|Args])).