summaryrefslogtreecommitdiff
path: root/Userland/Applications/CrashReporter
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-01-15 20:51:52 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-15 23:26:47 +0100
commit33c31e2198d6cc4cfde5ced24188d5894b5b060c (patch)
tree57f8d1c2622606c1bc5ece416e5b043838b797b8 /Userland/Applications/CrashReporter
parent0187fd4fdd7c9272265d24abe9a37debfb864dee (diff)
downloadserenity-33c31e2198d6cc4cfde5ced24188d5894b5b060c.zip
CrashReporter: Show arguments and environment
Arguments as a simple label, environment in a new tab. :^) Closes #4779.
Diffstat (limited to 'Userland/Applications/CrashReporter')
-rw-r--r--Userland/Applications/CrashReporter/CrashReporterWindow.gml18
-rw-r--r--Userland/Applications/CrashReporter/main.cpp16
2 files changed, 34 insertions, 0 deletions
diff --git a/Userland/Applications/CrashReporter/CrashReporterWindow.gml b/Userland/Applications/CrashReporter/CrashReporterWindow.gml
index ed7c942ff5..b8da3b014a 100644
--- a/Userland/Applications/CrashReporter/CrashReporterWindow.gml
+++ b/Userland/Applications/CrashReporter/CrashReporterWindow.gml
@@ -58,6 +58,24 @@
}
}
+ @GUI::Widget {
+ fixed_height: 18
+
+ layout: @GUI::HorizontalBoxLayout {
+ }
+
+ @GUI::Label {
+ text: "Arguments:"
+ text_alignment: "CenterLeft"
+ fixed_width: 90
+ }
+
+ @GUI::Label {
+ name: "arguments_label"
+ text_alignment: "CenterLeft"
+ }
+ }
+
@GUI::TabWidget {
name: "tab_widget"
}
diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp
index 80b8ea162a..c6ccb61e51 100644
--- a/Userland/Applications/CrashReporter/main.cpp
+++ b/Userland/Applications/CrashReporter/main.cpp
@@ -105,6 +105,8 @@ int main(int argc, char** argv)
Vector<TitleAndText> thread_backtraces;
String executable_path;
+ Vector<String> arguments;
+ Vector<String> environment;
int pid { 0 };
u8 termination_signal { 0 };
@@ -123,6 +125,8 @@ int main(int argc, char** argv)
});
executable_path = coredump->process_executable_path();
+ arguments = coredump->process_arguments();
+ environment = coredump->process_environment();
pid = coredump->process_pid();
termination_signal = coredump->process_termination_signal();
}
@@ -188,6 +192,9 @@ int main(int argc, char** argv)
Desktop::Launcher::open(URL::create_with_file_protocol(LexicalPath(coredump_path).dirname()));
};
+ auto& arguments_label = *widget.find_descendant_of_type_named<GUI::Label>("arguments_label");
+ arguments_label.set_text(String::join(" ", arguments));
+
auto& tab_widget = *widget.find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
auto& backtrace_tab = tab_widget.add_tab<GUI::Widget>("Backtrace");
@@ -209,6 +216,15 @@ int main(int argc, char** argv)
backtrace_text_editor.set_should_hide_unnecessary_scrollbars(true);
}
+ auto& environment_tab = tab_widget.add_tab<GUI::Widget>("Environment");
+ environment_tab.set_layout<GUI::VerticalBoxLayout>();
+ environment_tab.layout()->set_margins({ 4, 4, 4, 4 });
+
+ auto& environment_text_editor = environment_tab.add<GUI::TextEditor>();
+ environment_text_editor.set_text(String::join("\n", environment));
+ environment_text_editor.set_mode(GUI::TextEditor::Mode::ReadOnly);
+ environment_text_editor.set_should_hide_unnecessary_scrollbars(true);
+
auto& close_button = *widget.find_descendant_of_type_named<GUI::Button>("close_button");
close_button.on_click = [&](auto) {
app->quit();