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

UserspaceEmulator: Add a simple debugging Console

For now this only allows us to single-step through execution and inspect
part of the execution environment for debugging
This also allows to run to function return and sending signals to the VM

This changes the behavior of SIGINT for UE to pause execution and then
terminate if already paused

A way of setting a watchpoint for a function would be a good addition in
the future, the scaffold for this is already present, we only need to
figure out a way to find the address of a function

On a side note I have changed all occurences of west-const to east const
This commit is contained in:
Hendiadyoin1 2021-05-13 19:33:58 +02:00 committed by Ali Mohammad Pur
parent 9dfc96f89b
commit 5d24b5f4be
5 changed files with 242 additions and 34 deletions

View file

@ -20,11 +20,15 @@ bool g_report_to_debug = false;
int main(int argc, char** argv, char** env)
{
Vector<String> arguments;
bool pause_on_startup { false };
Core::ArgsParser parser;
parser.set_stop_on_first_non_option(true);
parser.add_option(g_report_to_debug, "Write reports to the debug log", "report-to-debug", 0);
parser.add_option(pause_on_startup, "Pause on startup", "pause", 'p');
parser.add_positional_argument(arguments, "Command to emulate", "command");
parser.parse(argc, argv);
String executable_path;
@ -59,5 +63,9 @@ int main(int argc, char** argv, char** env)
reportln("pthread_setname_np: {}", strerror(rc));
return 1;
}
if (pause_on_startup)
emulator.pause();
return emulator.exec();
}