1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 12:40:36 +00:00

Adds method to allow closing the connection with the IDE.

In order to allow $DEBUG to work with programs that call CLEAR, the connection handle used to connect to the IDE is locked by default and cannot be CLOSEd. With this change, the debuggee itself can now unlock the handle and close the link.
This commit is contained in:
FellippeHeitor 2021-07-22 00:18:34 -03:00
parent 30348dd2db
commit 231e28c79b
4 changed files with 26 additions and 5 deletions

View file

@ -5397,6 +5397,14 @@ extern uint32 error_retry;
void sub__echo(qbs *message);
void unlockvWatchHandle() {
if (vwatch>0) vwatch=-1;
}
int32 vWatchHandle() {
return vwatch;
}
void sub__assert(int32 expression, qbs *assert_message, int32 passed) {
if (asserts==0) return;
if (expression==0) {

View file

@ -12,6 +12,9 @@ extern void sub__consolefont(qbs* FontName, int FontSize);
extern void sub__console_cursor(int32 visible, int32 cursorsize, int32 passed);
extern int32 func__getconsoleinput();
extern void unlockvWatchHandle();
extern int32 vWatchHandle();
#ifdef DEPENDENCY_ZLIB
#include <zlib.h>
qbs *func__deflate(qbs *text);

View file

@ -8768,7 +8768,16 @@ DO
END IF
END IF
IF firstelement$ = "CHAIN" THEN
IF vWatchOn THEN
addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), "Feature incompatible with $DEBUG MODE", "CHAIN"
END IF
END IF
IF firstelement$ = "RUN" THEN 'RUN
IF vWatchOn THEN
addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), "Feature incompatible with $DEBUG MODE", "RUN"
END IF
l$ = SCase$("Run")
IF n = 1 THEN
'no parameters

View file

@ -13,6 +13,7 @@ SUB vwatch (localVariables AS _OFFSET)
DECLARE LIBRARY
SUB vwatch_stoptimers ALIAS stop_timers
SUB vwatch_starttimers ALIAS start_timers
SUB unlockvWatchHandle
END DECLARE
IF bypass THEN EXIT SUB
@ -35,7 +36,7 @@ SUB vwatch (localVariables AS _OFFSET)
SELECT CASE cmd$
CASE "vwatch"
IF value$ <> "ok" THEN
CLOSE #ideHost
unlockvWatchHandle: CLOSE #ideHost
bypass = -1
EXIT SUB
END IF
@ -48,7 +49,7 @@ SUB vwatch (localVariables AS _OFFSET)
IF LEN(value$) \ 4 <> breakpointCount THEN
cmd$ = "quit:Communication error."
GOSUB SendCommand
CLOSE #ideHost
unlockvWatchHandle: CLOSE #ideHost
bypass = -1
EXIT SUB
END IF
@ -62,7 +63,7 @@ SUB vwatch (localVariables AS _OFFSET)
IF LEN(value$) \ 4 <> skipCount THEN
cmd$ = "quit:Communication error."
GOSUB SendCommand
CLOSE #ideHost
unlockvWatchHandle: CLOSE #ideHost
bypass = -1
EXIT SUB
END IF
@ -85,7 +86,7 @@ SUB vwatch (localVariables AS _OFFSET)
GOSUB SendCallStack
cmd$ = "quit:Program ended."
GOSUB SendCommand
CLOSE #ideHost
unlockvWatchHandle: CLOSE #ideHost
bypass = -1
ideHost = 0
EXIT SUB
@ -193,7 +194,7 @@ SUB vwatch (localVariables AS _OFFSET)
vwatch_starttimers
EXIT SUB
CASE "free"
CLOSE #ideHost
unlockvWatchHandle: CLOSE #ideHost
ideHost = 0
bypass = -1
vwatch_starttimers