mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-15 07:09:43 +03:00
CrashReporter: Show termination signal
...in both text (using strsignal) and numeric form. Closes #4775.
This commit is contained in:
parent
0571a17f57
commit
bf45a28a89
Notes:
sideshowbarker
2024-07-19 00:08:14 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/bf45a28a893 Pull-request: https://github.com/SerenityOS/serenity/pull/4780
@ -45,6 +45,7 @@
|
||||
#include <LibGUI/LinkLabel.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <string.h>
|
||||
|
||||
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<GUI::Label>("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<GUI::LinkLabel>("executable_link");
|
||||
executable_link_label.set_text(LexicalPath::canonicalized_path(executable_path));
|
||||
|
Loading…
Reference in New Issue
Block a user