aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/cdv_wx.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2017-09-19 16:29:33 +0200
committerSiri Hansen <[email protected]>2017-09-19 16:29:33 +0200
commit8b24be58d37a8912efdcec9cd1e354cfa41e4ef4 (patch)
tree4dd56d366268fbb37e12ea9d564e9f24b81566aa /lib/observer/src/cdv_wx.erl
parent6d11362936408091aa7108c252f2f7bf20cdc327 (diff)
parent3979e914660993a06f1a84dd6e4196181964609a (diff)
downloadotp-8b24be58d37a8912efdcec9cd1e354cfa41e4ef4.tar.gz
otp-8b24be58d37a8912efdcec9cd1e354cfa41e4ef4.tar.bz2
otp-8b24be58d37a8912efdcec9cd1e354cfa41e4ef4.zip
Merge branch 'maint'
Conflicts: lib/observer/src/crashdump_viewer.erl lib/sasl/src/sasl.appup.src lib/stdlib/src/stdlib.appup.src
Diffstat (limited to 'lib/observer/src/cdv_wx.erl')
-rw-r--r--lib/observer/src/cdv_wx.erl38
1 files changed, 37 insertions, 1 deletions
diff --git a/lib/observer/src/cdv_wx.erl b/lib/observer/src/cdv_wx.erl
index 8cc135d174..0e33c9e618 100644
--- a/lib/observer/src/cdv_wx.erl
+++ b/lib/observer/src/cdv_wx.erl
@@ -413,7 +413,16 @@ load_dump(Frame,undefined) ->
error
end;
load_dump(Frame,FileName) ->
- ok = observer_lib:display_progress_dialog("Crashdump Viewer",
+ case maybe_warn_filename(FileName) of
+ continue ->
+ do_load_dump(Frame,FileName);
+ stop ->
+ error
+ end.
+
+do_load_dump(Frame,FileName) ->
+ ok = observer_lib:display_progress_dialog(wx:null(),
+ "Crashdump Viewer",
"Loading crashdump"),
crashdump_viewer:read_file(FileName),
case observer_lib:wait_for_progress() of
@@ -433,6 +442,33 @@ load_dump(Frame,FileName) ->
error
end.
+maybe_warn_filename(FileName) ->
+ case os:getenv("ERL_CRASH_DUMP_SECONDS")=="0" orelse
+ os:getenv("ERL_CRASH_DUMP_BYTES")=="0" of
+ true ->
+ continue;
+ false ->
+ DumpName = case os:getenv("ERL_CRASH_DUMP") of
+ false -> filename:absname("erl_crash.dump");
+ Name -> filename:absname(Name)
+ end,
+ case filename:absname(FileName) of
+ DumpName ->
+ Warning =
+ "WARNING: the current crashdump might be overwritten "
+ "if the crashdump_viewer node crashes.\n\n"
+ "Renaming the file before inspecting it will "
+ "remove the problem.\n\n"
+ "Do you want to continue?",
+ case observer_lib:display_yes_no_dialog(Warning) of
+ ?wxID_YES -> continue;
+ ?wxID_NO -> stop
+ end;
+ _ ->
+ continue
+ end
+ end.
+
%%%-----------------------------------------------------------------
%%% Find help document (HTML files)
get_help_doc(HelpId) ->