1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

HackStudio: Add option to inspect Coredump

This adds a --coredump <file> option to Hack Studio.

When used, Hack Studio will open the coredump and allow the user to
inspect it in the Debug tab.
This commit is contained in:
Itamar 2021-11-19 16:13:07 +02:00 committed by Linus Groh
parent ce726fe027
commit 8316eb7306
8 changed files with 72 additions and 19 deletions

View file

@ -52,14 +52,16 @@ int main(int argc, char** argv)
}
const char* path_argument = nullptr;
bool mode_coredump = false;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path_argument, "Path to a workspace or a file", "path", Core::ArgsParser::Required::No);
args_parser.add_option(mode_coredump, "Inspect a coredump in HackStudio", "coredump", 'c');
args_parser.parse(argc, argv);
auto argument_absolute_path = Core::File::real_path_for(path_argument);
auto project_path = argument_absolute_path;
if (argument_absolute_path.is_null())
if (argument_absolute_path.is_null() || mode_coredump)
project_path = Core::File::real_path_for(".");
s_hack_studio_widget = window->set_main_widget<HackStudioWidget>(project_path);
@ -76,9 +78,11 @@ int main(int argc, char** argv)
};
window->show();
s_hack_studio_widget->update_actions();
if (mode_coredump)
s_hack_studio_widget->open_coredump(argument_absolute_path);
return app->exec();
}