From 761169f5c0ca021e097c1ae53da8198e739b0f64 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 30 Dec 2020 14:46:15 +0100 Subject: [PATCH] CrashReporter: Show PID from coredump --- Applications/CrashReporter/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Applications/CrashReporter/main.cpp b/Applications/CrashReporter/main.cpp index 815fec911d..4c73049e81 100644 --- a/Applications/CrashReporter/main.cpp +++ b/Applications/CrashReporter/main.cpp @@ -62,6 +62,7 @@ int main(int argc, char** argv) Optional backtrace; String executable_path; + int pid { 0 }; { auto coredump = CoreDump::Reader::create(coredump_path); @@ -72,6 +73,7 @@ int main(int argc, char** argv) auto& process_info = coredump->process_info(); backtrace = coredump->backtrace(); executable_path = String(process_info.executable_path); + pid = process_info.pid; } auto app = GUI::Application::construct(argc, argv); @@ -122,7 +124,7 @@ int main(int argc, char** argv) app_name = af->name(); auto& description_label = static_cast(*widget.find_descendant_by_name("description")); - description_label.set_text(String::formatted("\"{}\" has crashed!", app_name)); + description_label.set_text(String::formatted("\"{}\" (PID {}) has crashed!", app_name, pid)); auto& executable_link_label = static_cast(*widget.find_descendant_by_name("executable_link")); executable_link_label.set_text(LexicalPath::canonicalized_path(executable_path));