aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/proc_lib.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-05-30 09:55:00 +0200
committerHans Bolinder <[email protected]>2017-06-09 09:11:14 +0200
commit32d1fbc35eda854bab579bdb46edfb3eccf522c2 (patch)
treed9de466cfd21d8d328b4b14ec9253a4f06255bad /lib/stdlib/src/proc_lib.erl
parent340be6a674946a1b4ae6edd42d68427f1c4acc26 (diff)
downloadotp-32d1fbc35eda854bab579bdb46edfb3eccf522c2.tar.gz
otp-32d1fbc35eda854bab579bdb46edfb3eccf522c2.tar.bz2
otp-32d1fbc35eda854bab579bdb46edfb3eccf522c2.zip
stdlib: Handle Unicode atoms when formatting stacktraces
Diffstat (limited to 'lib/stdlib/src/proc_lib.erl')
-rw-r--r--lib/stdlib/src/proc_lib.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stdlib/src/proc_lib.erl b/lib/stdlib/src/proc_lib.erl
index 3fa54cd0d5..9ce8e7d60e 100644
--- a/lib/stdlib/src/proc_lib.erl
+++ b/lib/stdlib/src/proc_lib.erl
@@ -805,16 +805,21 @@ format_exception(Class, Reason, StackTrace, {Enc,_}=Extra) ->
[EI, lib:format_exception(1+length(EI), Class, Reason,
StackTrace, StackFun, PF, Enc), "\n"].
-format_mfa(Indent, {M,F,Args}=StartF, Extra) ->
+format_mfa(Indent, {M,F,Args}=StartF, {Enc,_}=Extra) ->
try
A = length(Args),
- [Indent,"initial call: ",atom_to_list(M),$:,atom_to_list(F),$/,
+ [Indent,"initial call: ",atom_to_list(M),$:,to_string(F, Enc),$/,
integer_to_list(A),"\n"]
catch
error:_ ->
format_tag(Indent, initial_call, StartF, Extra)
end.
+to_string(A, latin1) ->
+ io_lib:write_atom_as_latin1(A);
+to_string(A, _) ->
+ io_lib:write_atom(A).
+
pp_fun({Enc,Depth}) ->
{Letter,Tl} = case Depth of
unlimited -> {"p",[]};