diff options
Diffstat (limited to 'lib/debugger')
-rw-r--r-- | lib/debugger/src/Makefile | 4 | ||||
-rw-r--r-- | lib/debugger/src/dbg_ieval.erl | 8 | ||||
-rw-r--r-- | lib/debugger/src/dbg_ui_trace.erl | 4 | ||||
-rw-r--r-- | lib/debugger/src/dbg_wx_settings.erl | 2 | ||||
-rw-r--r-- | lib/debugger/src/dbg_wx_trace.erl | 2 | ||||
-rw-r--r-- | lib/debugger/src/i.erl | 4 | ||||
-rw-r--r-- | lib/debugger/src/int.erl | 72 | ||||
-rw-r--r-- | lib/debugger/test/erl_eval_SUITE.erl | 2 | ||||
-rw-r--r-- | lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl | 2 |
9 files changed, 56 insertions, 44 deletions
diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile index cadde8cd1b..85754da219 100644 --- a/lib/debugger/src/Makefile +++ b/lib/debugger/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2012. All Rights Reserved. +# Copyright Ericsson AB 1997-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -98,7 +98,7 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += +warn_obsolete_guard +ERL_COMPILE_FLAGS += +warn_obsolete_guard -Werror # ---------------------------------------------------- diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl index 3c084c53ac..f5744a6e14 100644 --- a/lib/debugger/src/dbg_ieval.erl +++ b/lib/debugger/src/dbg_ieval.erl @@ -345,15 +345,15 @@ trace(What, Args, true) -> {Called, {Le,Li,M,F,As}} = Args, case Called of extern -> - io_lib:format("++ (~w) <~w> ~w:~w~s~n", + io_lib:format("++ (~w) <~w> ~w:~w~ts~n", [Le,Li,M,F,format_args(As)]); local -> - io_lib:format("++ (~w) <~w> ~w~s~n", + io_lib:format("++ (~w) <~w> ~w~ts~n", [Le,Li,F,format_args(As)]) end; call_fun -> {Le,Li,F,As} = Args, - io_lib:format("++ (~w) <~w> ~w~s~n", + io_lib:format("++ (~w) <~w> ~w~ts~n", [Le, Li, F, format_args(As)]); return -> {Le,Val} = Args, @@ -362,7 +362,7 @@ trace(What, Args, true) -> bif -> {Le,Li,M,F,As} = Args, - io_lib:format("++ (~w) <~w> ~w:~w~s~n", + io_lib:format("++ (~w) <~w> ~w:~w~ts~n", [Le, Li, M, F, format_args(As)]) end, dbg_icmd:tell_attached({trace_output, Str}); diff --git a/lib/debugger/src/dbg_ui_trace.erl b/lib/debugger/src/dbg_ui_trace.erl index 8017069c50..3e1fb2dcae 100644 --- a/lib/debugger/src/dbg_ui_trace.erl +++ b/lib/debugger/src/dbg_ui_trace.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2012. All Rights Reserved. +%% Copyright Ericsson AB 1998-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -321,7 +321,7 @@ gui_cmd('Messages', State) -> fun(Msg, N) -> Str1 = io_lib:format(" ~w:", [N]), dbg_ui_trace_win:eval_output(Str1, bold), - Str2 = io_lib:format(" ~s~n",[io_lib:print(Msg)]), + Str2 = io_lib:format(" ~ts~n",[io_lib:print(Msg)]), dbg_ui_trace_win:eval_output(Str2, normal), N+1 end, diff --git a/lib/debugger/src/dbg_wx_settings.erl b/lib/debugger/src/dbg_wx_settings.erl index 94ecc5781d..20aac74c3d 100644 --- a/lib/debugger/src/dbg_wx_settings.erl +++ b/lib/debugger/src/dbg_wx_settings.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2011. All Rights Reserved. +%% Copyright Ericsson AB 2008-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl index 0a3cac905f..bd92cb4b42 100644 --- a/lib/debugger/src/dbg_wx_trace.erl +++ b/lib/debugger/src/dbg_wx_trace.erl @@ -331,7 +331,7 @@ gui_cmd('Messages', State) -> fun(Msg, N) -> Str1 = io_lib:format(" ~w:", [N]), dbg_wx_trace_win:eval_output(State#state.win,Str1, bold), - Str2 = io_lib:format(" ~s~n",[io_lib:print(Msg)]), + Str2 = io_lib:format(" ~ts~n",[io_lib:print(Msg)]), dbg_wx_trace_win:eval_output(State#state.win,Str2, normal), N+1 end, diff --git a/lib/debugger/src/i.erl b/lib/debugger/src/i.erl index 4d0b862196..5805501524 100644 --- a/lib/debugger/src/i.erl +++ b/lib/debugger/src/i.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2011. All Rights Reserved. +%% Copyright Ericsson AB 1998-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -197,7 +197,7 @@ get_file(Mod) -> end. ilformat(A1, A2) -> - format("~-20s ~s\n", [A1,A2]). + format("~-20s ~ts\n", [A1,A2]). %% ------------------------------------------- %% Print all break points in modules. diff --git a/lib/debugger/src/int.erl b/lib/debugger/src/int.erl index 1c9f2eddd1..bdd671cff1 100644 --- a/lib/debugger/src/int.erl +++ b/lib/debugger/src/int.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2011. All Rights Reserved. +%% Copyright Ericsson AB 1998-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -517,7 +517,7 @@ int_mod(AbsMod, Dist) when is_atom(AbsMod); is_list(AbsMod) -> [App, AbsMod]), error; _Error -> - io:format("** Invalid beam file or no abstract code: ~p\n", + io:format("** Invalid beam file or no abstract code: ~tp\n", [AbsMod]), error end. @@ -674,38 +674,50 @@ everywhere(local, Fun) -> Fun(). scan_module_name(File) -> - case erl_prim_loader:get_file(filename:absname(File)) of - {ok, Bin, _FullPath} -> - Chars = binary_to_list(Bin), - R = (catch {ok, scan_module_name_1(Chars)}), - case R of - {ok, A} when is_atom(A) -> A; - _ -> error - end; - _ -> - error + try + {ok, Bin, _FullPath} = + erl_prim_loader:get_file(filename:absname(File)), + scan_module_name_1([], <<>>, Bin, enc(Bin)) + catch + _:_ -> + throw({error, no_beam}) end. -scan_module_name_1(Chars) -> - case erl_scan:tokens("", Chars, 1) of - {done, {ok, Ts, _}, Rest} -> - scan_module_name_2(Ts, Rest); - _ -> - error +scan_module_name_1(Cont0, B0, Bin0, Enc) -> + N = min(100, byte_size(Bin0)), + {Bin1, Bin} = erlang:split_binary(Bin0, N), + {Chars, B1} = + case unicode:characters_to_list(list_to_binary([B0, Bin1]), Enc) of + {incomplete, List, Binary} -> + {List, Binary}; + List when is_list(List), List =/= [] -> + {List, <<>>} + end, + scan_module_name_2(Cont0, Chars, B1, Bin, Enc). + +scan_module_name_2(Cont0, Chars, B1, Bin, Enc) -> + case erl_scan:tokens(Cont0, Chars, _AnyLine = 1) of + {done, {ok, Ts, _}, Rest} -> + scan_module_name_3(Ts, Rest, B1, Bin, Enc); + {more, Cont} -> + scan_module_name_1(Cont, B1, Bin, Enc) end. -scan_module_name_2([{'-',_},{atom,_,module},{'(',_} | _]=Ts, _Chars) -> - scan_module_name_3(Ts); -scan_module_name_2([{'-',_},{atom,_,_} | _], Chars) -> - scan_module_name_1(Chars); -scan_module_name_2(_, _) -> - error. - -scan_module_name_3(Ts) -> - case erl_parse:parse_form(Ts) of - {ok, {attribute,_,module,{M,_}}} -> M; - {ok, {attribute,_,module,M}} -> M; - _ -> error +scan_module_name_3([{'-',_},{atom,_,module},{'(',_} | _]=Ts, + _Chars, _B1, _Bin, _Enc) -> + scan_module_name_4(Ts); +scan_module_name_3([{'-',_},{atom,_,_} | _], Chars, B1, Bin, Enc) -> + scan_module_name_2("", Chars, B1, Bin, Enc). + +scan_module_name_4(Ts) -> + {ok, {attribute,_,module,M}} = erl_parse:parse_form(Ts), + true = is_atom(M), + M. + +enc(Bin) -> + case epp:read_encoding_from_binary(Bin) of + none -> epp:default_encoding(); + Encoding -> Encoding end. %%--Stop interpreting modules----------------------------------------- diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index c675f704b4..bb2669f450 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2011. All Rights Reserved. +%% Copyright Ericsson AB 2003-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl index 0d7883f067..c5c6a56363 100644 --- a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl +++ b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2011. All Rights Reserved. +%% Copyright Ericsson AB 1999-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in |