mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
CrashReporter: Show the available memory region information
This commit is contained in:
parent
efe5f37b04
commit
8d5fb99703
Notes:
sideshowbarker
2024-07-18 00:54:21 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/8d5fb99703f Pull-request: https://github.com/SerenityOS/serenity/pull/10999 Reviewed-by: https://github.com/linusg ✅
@ -188,6 +188,7 @@ int main(int argc, char** argv)
|
||||
String executable_path;
|
||||
Vector<String> arguments;
|
||||
Vector<String> environment;
|
||||
Vector<String> memory_regions;
|
||||
int pid { 0 };
|
||||
u8 termination_signal { 0 };
|
||||
|
||||
@ -206,6 +207,11 @@ int main(int argc, char** argv)
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
coredump->for_each_memory_region_info([&](auto& memory_region_info) {
|
||||
memory_regions.append(String::formatted("{:p} - {:p}: {}", memory_region_info.region_start, memory_region_info.region_end, (const char*)memory_region_info.region_name));
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
executable_path = coredump->process_executable_path();
|
||||
arguments = coredump->process_arguments();
|
||||
environment = coredump->process_environment();
|
||||
@ -344,6 +350,15 @@ int main(int argc, char** argv)
|
||||
environment_text_editor.set_mode(GUI::TextEditor::Mode::ReadOnly);
|
||||
environment_text_editor.set_should_hide_unnecessary_scrollbars(true);
|
||||
|
||||
auto& memory_regions_tab = tab_widget.add_tab<GUI::Widget>("Memory Regions");
|
||||
memory_regions_tab.set_layout<GUI::VerticalBoxLayout>();
|
||||
memory_regions_tab.layout()->set_margins(4);
|
||||
|
||||
auto& memory_regions_text_editor = memory_regions_tab.add<GUI::TextEditor>();
|
||||
memory_regions_text_editor.set_text(String::join("\n", memory_regions));
|
||||
memory_regions_text_editor.set_mode(GUI::TextEditor::Mode::ReadOnly);
|
||||
memory_regions_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) {
|
||||
if (unlink_on_exit)
|
||||
|
Loading…
Reference in New Issue
Block a user