From bf45a28a893f169e6d026be7f3fb59284929b230 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 3 Jan 2021 21:51:22 +0100 Subject: [PATCH] CrashReporter: Show termination signal ...in both text (using strsignal) and numeric form. Closes #4775. --- Applications/CrashReporter/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Applications/CrashReporter/main.cpp b/Applications/CrashReporter/main.cpp index 9a190186acd..047a696ea34 100644 --- a/Applications/CrashReporter/main.cpp +++ b/Applications/CrashReporter/main.cpp @@ -45,6 +45,7 @@ #include #include #include +#include static String build_backtrace(const CoreDump::Reader& coredump) { @@ -87,6 +88,7 @@ int main(int argc, char** argv) String backtrace; String executable_path; int pid { 0 }; + u8 termination_signal { 0 }; { auto coredump = CoreDump::Reader::create(coredump_path); @@ -98,6 +100,7 @@ int main(int argc, char** argv) backtrace = build_backtrace(*coredump); executable_path = String(process_info.executable_path); pid = process_info.pid; + termination_signal = process_info.termination_signal; } auto app = GUI::Application::construct(argc, argv); @@ -147,7 +150,7 @@ int main(int argc, char** argv) app_name = af->name(); auto& description_label = *widget.find_descendant_of_type_named("description"); - description_label.set_text(String::formatted("\"{}\" (PID {}) has crashed!", app_name, pid)); + description_label.set_text(String::formatted("\"{}\" (PID {}) has crashed - {} (signal {})", app_name, pid, strsignal(termination_signal), termination_signal)); auto& executable_link_label = *widget.find_descendant_of_type_named("executable_link"); executable_link_label.set_text(LexicalPath::canonicalized_path(executable_path));