mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-20 12:45:13 +00:00
Allows a debuggee to call CLEAR
while keeping connected to the IDE.
This commit is contained in:
parent
77daecccbc
commit
30348dd2db
|
@ -13096,8 +13096,12 @@ void sub_close(int32 i2,int32 passed){
|
||||||
|
|
||||||
|
|
||||||
for (i=1;i<=special_handles->indexes;i++){
|
for (i=1;i<=special_handles->indexes;i++){
|
||||||
|
if (vwatch>0 && vwatch==i) {
|
||||||
|
//keep connection to the IDE open for $DEBUG mode
|
||||||
|
} else {
|
||||||
sub_close(-i-1,1);
|
sub_close(-i-1,1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (i=1;i<=gfs_fileno_n;i++){
|
for (i=1;i<=gfs_fileno_n;i++){
|
||||||
|
@ -21892,7 +21896,11 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
if ((method==0)||(method==1)){
|
if ((method==0)||(method==1)){
|
||||||
|
|
||||||
if (parts<2) return -1;
|
if (parts<2) return -1;
|
||||||
if (qbs_equal(qbs_ucase(info_part[1]),qbs_new_txt("TCP/IP"))==0) return -1;
|
if (qbs_equal(qbs_ucase(info_part[1]),qbs_new_txt("TCP/IP"))==0) {
|
||||||
|
if (qbs_equal(qbs_ucase(info_part[1]),qbs_new_txt("QB64IDE"))==0 || vwatch!=-1) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
d=func_val(info_part[2]);
|
d=func_val(info_part[2]);
|
||||||
port=qbr_double_to_long(d);//***assume*** port number is within valid range
|
port=qbr_double_to_long(d);//***assume*** port number is within valid range
|
||||||
|
@ -21923,6 +21931,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
//init stream
|
//init stream
|
||||||
my_stream_struct->in=NULL; my_stream_struct->in_size=0; my_stream_struct->in_limit=0;
|
my_stream_struct->in=NULL; my_stream_struct->in_size=0; my_stream_struct->in_limit=0;
|
||||||
|
|
||||||
|
if (vwatch==-1) vwatch=my_handle;
|
||||||
return my_handle;
|
return my_handle;
|
||||||
}//client
|
}//client
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,11 @@ REDIM SHARED PP_TypeMod(0) AS STRING, PP_ConvertedMod(0) AS STRING 'Prepass Name
|
||||||
Set_OrderOfOperations
|
Set_OrderOfOperations
|
||||||
|
|
||||||
DIM SHARED vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
|
DIM SHARED vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
|
||||||
DIM SHARED vWatchNewVariable$
|
DIM SHARED vWatchNewVariable$, vWatchVariableExclusions$
|
||||||
vWatchErrorCall$ = "if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"
|
vWatchErrorCall$ = "if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"
|
||||||
|
vWatchVariableExclusions$ = "@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@" + _
|
||||||
|
"@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS" + _
|
||||||
|
"@__ARRAY_BYTE_VWATCH_SKIPLINES@"
|
||||||
|
|
||||||
DIM SHARED qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
|
DIM SHARED qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
|
||||||
DIM SHARED opex_recompileAttempts, opex_desiredState
|
DIM SHARED opex_recompileAttempts, opex_desiredState
|
||||||
|
@ -11395,6 +11398,9 @@ FOR i = 1 TO idn
|
||||||
getid i
|
getid i
|
||||||
IF Error_Happened THEN GOTO errmes
|
IF Error_Happened THEN GOTO errmes
|
||||||
IF id.arrayelements = -1 THEN GOTO clearerasereturned 'cannot erase non-existant array
|
IF id.arrayelements = -1 THEN GOTO clearerasereturned 'cannot erase non-existant array
|
||||||
|
IF INSTR(vWatchVariableExclusions$, "@" + RTRIM$(id.callname) + "@") > 0 THEN
|
||||||
|
GOTO clearerasereturned
|
||||||
|
END IF
|
||||||
clearerasereturn = 1: GOTO clearerase
|
clearerasereturn = 1: GOTO clearerase
|
||||||
END IF 'array
|
END IF 'array
|
||||||
|
|
||||||
|
@ -11417,15 +11423,19 @@ FOR i = 1 TO idn
|
||||||
PRINT #12, "memset((void*)(" + e$ + "->chr),0," + bytes$ + ");"
|
PRINT #12, "memset((void*)(" + e$ + "->chr),0," + bytes$ + ");"
|
||||||
GOTO cleared
|
GOTO cleared
|
||||||
ELSE
|
ELSE
|
||||||
|
IF INSTR(vWatchVariableExclusions$, "@" + e$ + "@") = 0 AND LEFT$(e$, 12) <> "_SUB_VWATCH_" THEN
|
||||||
PRINT #12, e$ + "->len=0;"
|
PRINT #12, e$ + "->len=0;"
|
||||||
|
END IF
|
||||||
GOTO cleared
|
GOTO cleared
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
IF typ AND ISUDT THEN
|
IF typ AND ISUDT THEN
|
||||||
PRINT #12, "memset((void*)" + e$ + ",0," + bytes$ + ");"
|
PRINT #12, "memset((void*)" + e$ + ",0," + bytes$ + ");"
|
||||||
ELSE
|
ELSE
|
||||||
|
IF INSTR(vWatchVariableExclusions$, "@" + e$ + "@") = 0 AND LEFT$(e$, 12) <> "_SUB_VWATCH_" THEN
|
||||||
PRINT #12, "*" + e$ + "=0;"
|
PRINT #12, "*" + e$ + "=0;"
|
||||||
END IF
|
END IF
|
||||||
|
END IF
|
||||||
GOTO cleared
|
GOTO cleared
|
||||||
END IF 'non-array variable
|
END IF 'non-array variable
|
||||||
|
|
||||||
|
@ -11695,7 +11705,7 @@ ELSE
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF vWatchOn THEN
|
IF vWatchOn THEN
|
||||||
PRINT #18, "int32 vwatch=1;"
|
PRINT #18, "int32 vwatch=-1;"
|
||||||
ELSE
|
ELSE
|
||||||
PRINT #18, "int32 vwatch=0;"
|
PRINT #18, "int32 vwatch=0;"
|
||||||
END IF
|
END IF
|
||||||
|
@ -14197,17 +14207,10 @@ END SUB
|
||||||
SUB vWatchVariable (this$, action AS _BYTE)
|
SUB vWatchVariable (this$, action AS _BYTE)
|
||||||
STATIC totalLocalVariables AS LONG, localVariablesList$
|
STATIC totalLocalVariables AS LONG, localVariablesList$
|
||||||
STATIC totalMainModuleVariables AS LONG, mainModuleVariablesList$
|
STATIC totalMainModuleVariables AS LONG, mainModuleVariablesList$
|
||||||
STATIC exclusions$
|
|
||||||
|
|
||||||
IF LEN(exclusions$) = 0 THEN
|
|
||||||
exclusions$ = "@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@" + _
|
|
||||||
"@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS" + _
|
|
||||||
"@__ARRAY_BYTE_VWATCH_SKIPLINES@"
|
|
||||||
END IF
|
|
||||||
|
|
||||||
SELECT CASE action
|
SELECT CASE action
|
||||||
CASE 0 'add
|
CASE 0 'add
|
||||||
IF INSTR(exclusions$, "@" + this$ + "@") > 0 OR LEFT$(this$, 12) = "_SUB_VWATCH_" THEN
|
IF INSTR(vWatchVariableExclusions$, "@" + this$ + "@") > 0 OR LEFT$(this$, 12) = "_SUB_VWATCH_" THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
start! = TIMER
|
start! = TIMER
|
||||||
DO
|
DO
|
||||||
k& = _KEYHIT
|
k& = _KEYHIT
|
||||||
ideHost = _OPENCLIENT("TCP/IP:" + ideport$ + ":localhost")
|
ideHost = _OPENCLIENT("QB64IDE:" + ideport$ + ":localhost")
|
||||||
_LIMIT 30
|
_LIMIT 30
|
||||||
LOOP UNTIL k& = 27 OR ideHost <> 0 OR TIMER - start! > timeout
|
LOOP UNTIL k& = 27 OR ideHost <> 0 OR TIMER - start! > timeout
|
||||||
IF ideHost = 0 THEN bypass = -1: EXIT SUB
|
IF ideHost = 0 THEN bypass = -1: EXIT SUB
|
||||||
|
|
Loading…
Reference in a new issue