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

HackStudio: Add 'pause debuggee' button

This button sends a SIGSTOP to the debugged process, which pauses it.
The debuggee can be resumed with the 'continue' button.
This commit is contained in:
Itamar 2023-02-19 22:52:52 +02:00 committed by Andreas Kling
parent 91224d47d2
commit 47f5a3ea9a
8 changed files with 44 additions and 11 deletions

View file

@ -100,6 +100,7 @@ public:
Syscall,
};
void continue_debuggee(ContinueType type = ContinueType::FreeRun);
void stop_debuggee();
// Returns the wstatus result of waitpid()
int continue_debuggee_and_wait(ContinueType type = ContinueType::FreeRun);
@ -169,7 +170,7 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
// FIXME: This check actually only checks whether the debuggee
// stopped because it hit a breakpoint/syscall/is in single stepping mode or not
if (WSTOPSIG(wstatus) != SIGTRAP) {
if (WSTOPSIG(wstatus) != SIGTRAP && WSTOPSIG(wstatus) != SIGSTOP) {
callback(DebugBreakReason::Exited, Optional<PtraceRegisters>());
m_is_debuggee_dead = true;
return true;