From 9280365122640ba84f0c68725949a9622c184acc Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 2 Feb 2022 20:57:31 +0100 Subject: [PATCH] Debug.Signal() is a new method that signals a debugged gambas process with SIGUSR2 to ask him to pause. [GB.DEBUG] * NEW: Debug.Signal() is a new method that signals a debugged gambas process with SIGUSR2 to ask him to pause. --- main/lib/debug/CDebug.c | 8 ++++++++ main/lib/debug/debug.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/main/lib/debug/CDebug.c b/main/lib/debug/CDebug.c index 2eef79552..46d124d32 100644 --- a/main/lib/debug/CDebug.c +++ b/main/lib/debug/CDebug.c @@ -289,6 +289,12 @@ BEGIN_PROPERTY(Debug_Fifo) END_PROPERTY +BEGIN_METHOD(Debug_Signal, GB_INTEGER pid) + + kill(VARG(pid), SIGUSR2); + +END_METHOD + GB_DESC CDebugDesc[] = { @@ -306,6 +312,8 @@ GB_DESC CDebugDesc[] = GB_STATIC_METHOD("Write", NULL, Debug_Write, "(Data)s"), + GB_STATIC_METHOD("Signal", NULL, Debug_Signal, "(ProcessId)i"), + GB_STATIC_PROPERTY_READ("Fifo", "s", Debug_Fifo), GB_EVENT("Read", NULL, "(Data)s", &EVENT_Read), diff --git a/main/lib/debug/debug.c b/main/lib/debug/debug.c index 3430a52be..487a321e0 100644 --- a/main/lib/debug/debug.c +++ b/main/lib/debug/debug.c @@ -1305,6 +1305,8 @@ void DEBUG_main(bool error) static DEBUG_COMMAND Command[] = { + // "p" and "i" are reserved for remote debugging. + { "q", TC_NONE, command_quit, FALSE }, { "n", TC_NEXT, command_next, FALSE }, { "s", TC_STEP, command_step, FALSE },