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 thread_backtraces; String executable_path; + Vector arguments; + Vector 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("arguments_label"); + arguments_label.set_text(String::join(" ", arguments)); + auto& tab_widget = *widget.find_descendant_of_type_named("tab_widget"); auto& backtrace_tab = tab_widget.add_tab("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("Environment"); + environment_tab.set_layout(); + environment_tab.layout()->set_margins({ 4, 4, 4, 4 }); + + auto& environment_text_editor = environment_tab.add(); + 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("close_button"); close_button.on_click = [&](auto) { app->quit();