mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-22 02:05:08 +00:00
Merge branch 'var-export' into development
This commit is contained in:
commit
5cbe6d87f2
6 changed files with 1177 additions and 609 deletions
|
@ -42,6 +42,7 @@ DIM SHARED QuickNavTotal AS LONG
|
||||||
DIM SHARED QuickNavHistory(0) AS QuickNavType
|
DIM SHARED QuickNavHistory(0) AS QuickNavType
|
||||||
|
|
||||||
REDIM SHARED IdeBreakpoints(1) AS _BYTE
|
REDIM SHARED IdeBreakpoints(1) AS _BYTE
|
||||||
|
REDIM SHARED IdeSkipLines(1) AS _BYTE
|
||||||
|
|
||||||
'GetInput global variables
|
'GetInput global variables
|
||||||
DIM SHARED iCHECKLATER 'the values will be checked later
|
DIM SHARED iCHECKLATER 'the values will be checked later
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -174,7 +174,7 @@ SUB Help_NewLine
|
||||||
IF Help_Pos > help_w THEN help_w = Help_Pos
|
IF Help_Pos > help_w THEN help_w = Help_Pos
|
||||||
|
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 13
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 13
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = col + Help_BG_Col * 16
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = Help_BG_Col * 16
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
||||||
|
|
||||||
|
|
309
source/qb64.bas
309
source/qb64.bas
|
@ -27,6 +27,7 @@ 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$
|
||||||
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;};"
|
||||||
|
|
||||||
DIM SHARED qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
|
DIM SHARED qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
|
||||||
|
@ -778,6 +779,8 @@ DIM SHARED findidinternal AS LONG
|
||||||
DIM SHARED currentid AS LONG 'is the index of the last ID accessed
|
DIM SHARED currentid AS LONG 'is the index of the last ID accessed
|
||||||
DIM SHARED linenumber AS LONG, reallinenumber AS LONG, totallinenumber AS LONG, definingtypeerror AS LONG
|
DIM SHARED linenumber AS LONG, reallinenumber AS LONG, totallinenumber AS LONG, definingtypeerror AS LONG
|
||||||
DIM SHARED wholeline AS STRING
|
DIM SHARED wholeline AS STRING
|
||||||
|
DIM SHARED firstLineNumberLabelvWatch AS LONG, lastLineNumberLabelvWatch AS LONG
|
||||||
|
DIM SHARED vWatchUsedLabels AS STRING
|
||||||
DIM SHARED linefragment AS STRING
|
DIM SHARED linefragment AS STRING
|
||||||
'COMMON SHARED bitmask() AS _INTEGER64
|
'COMMON SHARED bitmask() AS _INTEGER64
|
||||||
'COMMON SHARED bitmaskinv() AS _INTEGER64
|
'COMMON SHARED bitmaskinv() AS _INTEGER64
|
||||||
|
@ -1455,6 +1458,8 @@ duplicateConstWarning = 0
|
||||||
emptySCWarning = 0
|
emptySCWarning = 0
|
||||||
warningListItems = 0
|
warningListItems = 0
|
||||||
lastWarningHeader = ""
|
lastWarningHeader = ""
|
||||||
|
vWatchUsedLabels = SPACE$(1000)
|
||||||
|
firstLineNumberLabelvWatch = 0
|
||||||
REDIM SHARED warning$(1000)
|
REDIM SHARED warning$(1000)
|
||||||
REDIM SHARED warningLines(1000) AS LONG
|
REDIM SHARED warningLines(1000) AS LONG
|
||||||
REDIM SHARED warningIncLines(1000) AS LONG
|
REDIM SHARED warningIncLines(1000) AS LONG
|
||||||
|
@ -5278,18 +5283,7 @@ DO
|
||||||
layoutdone = 1: IF LEN(layout$) THEN layout$ = layout$ + sp + l$ ELSE layout$ = l$
|
layoutdone = 1: IF LEN(layout$) THEN layout$ = layout$ + sp + l$ ELSE layout$ = l$
|
||||||
|
|
||||||
IF vWatchOn = 1 THEN
|
IF vWatchOn = 1 THEN
|
||||||
totalLocalVariables = 0
|
vWatchVariable "", 1
|
||||||
localVariablesList$ = ""
|
|
||||||
FOR i = 1 TO totalVariablesCreated
|
|
||||||
IF usedVariableList(i).scope = subfuncn THEN
|
|
||||||
totalLocalVariables = totalLocalVariables + 1
|
|
||||||
localVariablesList$ = localVariablesList$ + "vwatch_local_vars[" + str2$(totalLocalVariables - 1) + "] = &" + usedVariableList(i).cname + ";" + CRLF
|
|
||||||
END IF
|
|
||||||
NEXT
|
|
||||||
IF totalLocalVariables > 0 THEN
|
|
||||||
PRINT #13, "void *vwatch_local_vars["; totalLocalVariables; "];"
|
|
||||||
PRINT #13, localVariablesList$
|
|
||||||
END IF
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
staticarraylist = "": staticarraylistn = 0 'remove previously listed arrays
|
staticarraylist = "": staticarraylistn = 0 'remove previously listed arrays
|
||||||
|
@ -5297,9 +5291,45 @@ DO
|
||||||
PRINT #12, "exit_subfunc:;"
|
PRINT #12, "exit_subfunc:;"
|
||||||
IF vWatchOn = 1 THEN
|
IF vWatchOn = 1 THEN
|
||||||
IF NoChecks = 0 THEN
|
IF NoChecks = 0 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
|
vWatchAddLabel 0, -1
|
||||||
END IF
|
END IF
|
||||||
PRINT #12, "*__LONG_VWATCH_SUBLEVEL=*__LONG_VWATCH_SUBLEVEL- 1 ;"
|
PRINT #12, "*__LONG_VWATCH_SUBLEVEL=*__LONG_VWATCH_SUBLEVEL- 1 ;"
|
||||||
|
|
||||||
|
IF subfunc <> "SUB_VWATCH" AND firstLineNumberLabelvWatch > 0 THEN
|
||||||
|
PRINT #12, "goto VWATCH_SKIPSETNEXTLINE;"
|
||||||
|
PRINT #12, "VWATCH_SETNEXTLINE:;"
|
||||||
|
PRINT #12, "switch (*__LONG_VWATCH_GOTO) {"
|
||||||
|
FOR i = firstLineNumberLabelvWatch TO lastLineNumberLabelvWatch
|
||||||
|
WHILE i > LEN(vWatchUsedLabels)
|
||||||
|
vWatchUsedLabels = vWatchUsedLabels + SPACE$(1000)
|
||||||
|
WEND
|
||||||
|
IF ASC(vWatchUsedLabels, i) = 1 THEN
|
||||||
|
PRINT #12, " case " + str2$(i) + ":"
|
||||||
|
PRINT #12, " goto VWATCH_LABEL_" + str2$(i) + ";"
|
||||||
|
PRINT #12, " break;"
|
||||||
|
END IF
|
||||||
|
NEXT
|
||||||
|
PRINT #12, " default:"
|
||||||
|
PRINT #12, " *__LONG_VWATCH_GOTO=*__LONG_VWATCH_LINENUMBER;"
|
||||||
|
PRINT #12, " goto VWATCH_SETNEXTLINE;"
|
||||||
|
PRINT #12, "}"
|
||||||
|
|
||||||
|
PRINT #12, "VWATCH_SKIPLINE:;"
|
||||||
|
PRINT #12, "switch (*__LONG_VWATCH_GOTO) {"
|
||||||
|
FOR i = firstLineNumberLabelvWatch TO lastLineNumberLabelvWatch
|
||||||
|
IF ASC(vWatchUsedLabels, i) = 1 THEN
|
||||||
|
PRINT #12, " case -" + str2$(i) + ":"
|
||||||
|
PRINT #12, " goto VWATCH_SKIPLABEL_" + str2$(i) + ";"
|
||||||
|
PRINT #12, " break;"
|
||||||
|
END IF
|
||||||
|
NEXT
|
||||||
|
PRINT #12, "}"
|
||||||
|
|
||||||
|
PRINT #12, "VWATCH_SKIPSETNEXTLINE:;"
|
||||||
|
END IF
|
||||||
|
firstLineNumberLabelvWatch = 0
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
'release _MEM lock for this scope
|
'release _MEM lock for this scope
|
||||||
|
@ -5528,6 +5558,10 @@ DO
|
||||||
IF controltype(controllevel) <> 2 THEN a$ = "NEXT without FOR": GOTO errmes
|
IF controltype(controllevel) <> 2 THEN a$ = "NEXT without FOR": GOTO errmes
|
||||||
IF n <> 1 AND controlvalue(controllevel) <> currentid THEN a$ = "Incorrect variable after NEXT": GOTO errmes
|
IF n <> 1 AND controlvalue(controllevel) <> currentid THEN a$ = "Incorrect variable after NEXT": GOTO errmes
|
||||||
PRINT #12, "fornext_continue_" + str2$(controlid(controllevel)) + ":;"
|
PRINT #12, "fornext_continue_" + str2$(controlid(controllevel)) + ":;"
|
||||||
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 AND NoChecks = 0 THEN
|
||||||
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
|
END IF
|
||||||
PRINT #12, "}"
|
PRINT #12, "}"
|
||||||
PRINT #12, "fornext_exit_" + str2$(controlid(controllevel)) + ":;"
|
PRINT #12, "fornext_exit_" + str2$(controlid(controllevel)) + ":;"
|
||||||
controllevel = controllevel - 1
|
controllevel = controllevel - 1
|
||||||
|
@ -5575,7 +5609,8 @@ DO
|
||||||
IF stringprocessinghappened THEN e$ = cleanupstringprocessingcall$ + e$ + ")"
|
IF stringprocessinghappened THEN e$ = cleanupstringprocessingcall$ + e$ + ")"
|
||||||
IF (typ AND ISSTRING) THEN a$ = "WHILE ERROR! Cannot accept a STRING type.": GOTO errmes
|
IF (typ AND ISSTRING) THEN a$ = "WHILE ERROR! Cannot accept a STRING type.": GOTO errmes
|
||||||
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
PRINT #12, "while((" + e$ + ")||new_error){"
|
PRINT #12, "while((" + e$ + ")||new_error){"
|
||||||
ELSE
|
ELSE
|
||||||
|
@ -5634,13 +5669,15 @@ DO
|
||||||
IF (typ AND ISSTRING) THEN a$ = "DO ERROR! Cannot accept a STRING type.": GOTO errmes
|
IF (typ AND ISSTRING) THEN a$ = "DO ERROR! Cannot accept a STRING type.": GOTO errmes
|
||||||
IF whileuntil = 1 THEN PRINT #12, "while((" + e$ + ")||new_error){" ELSE PRINT #12, "while((!(" + e$ + "))||new_error){"
|
IF whileuntil = 1 THEN PRINT #12, "while((" + e$ + ")||new_error){" ELSE PRINT #12, "while((!(" + e$ + "))||new_error){"
|
||||||
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
controltype(controllevel) = 4
|
controltype(controllevel) = 4
|
||||||
ELSE
|
ELSE
|
||||||
controltype(controllevel) = 3
|
controltype(controllevel) = 3
|
||||||
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 AND NoChecks = 0 THEN
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 AND NoChecks = 0 THEN
|
||||||
PRINT #12, "do{*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "do{*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
ELSE
|
ELSE
|
||||||
PRINT #12, "do{"
|
PRINT #12, "do{"
|
||||||
END IF
|
END IF
|
||||||
|
@ -5674,14 +5711,16 @@ DO
|
||||||
IF (typ AND ISSTRING) THEN a$ = "LOOP ERROR! Cannot accept a STRING type.": GOTO errmes
|
IF (typ AND ISSTRING) THEN a$ = "LOOP ERROR! Cannot accept a STRING type.": GOTO errmes
|
||||||
PRINT #12, "dl_continue_" + str2$(controlid(controllevel)) + ":;"
|
PRINT #12, "dl_continue_" + str2$(controlid(controllevel)) + ":;"
|
||||||
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
IF whileuntil = 1 THEN PRINT #12, "}while((" + e$ + ")&&(!new_error));" ELSE PRINT #12, "}while((!(" + e$ + "))&&(!new_error));"
|
IF whileuntil = 1 THEN PRINT #12, "}while((" + e$ + ")&&(!new_error));" ELSE PRINT #12, "}while((!(" + e$ + "))&&(!new_error));"
|
||||||
ELSE
|
ELSE
|
||||||
PRINT #12, "dl_continue_" + str2$(controlid(controllevel)) + ":;"
|
PRINT #12, "dl_continue_" + str2$(controlid(controllevel)) + ":;"
|
||||||
|
|
||||||
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF controltype(controllevel) = 4 THEN
|
IF controltype(controllevel) = 4 THEN
|
||||||
|
@ -5834,7 +5873,8 @@ DO
|
||||||
IF Error_Happened THEN GOTO errmes
|
IF Error_Happened THEN GOTO errmes
|
||||||
|
|
||||||
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
IF NoChecks = 0 AND vWatchOn = 1 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
PRINT #12, "fornext_step" + u$ + "=" + e$ + ";"
|
PRINT #12, "fornext_step" + u$ + "=" + e$ + ";"
|
||||||
|
@ -5921,7 +5961,8 @@ DO
|
||||||
IF NoChecks = 0 THEN
|
IF NoChecks = 0 THEN
|
||||||
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
||||||
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
FOR i = controllevel TO 1 STEP -1
|
FOR i = controllevel TO 1 STEP -1
|
||||||
|
@ -5962,7 +6003,8 @@ DO
|
||||||
IF NoChecks = 0 THEN
|
IF NoChecks = 0 THEN
|
||||||
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
||||||
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -6043,6 +6085,11 @@ DO
|
||||||
IF LEN(layout$) = 0 THEN layout$ = l$ ELSE layout$ = layout$ + sp + l$
|
IF LEN(layout$) = 0 THEN layout$ = l$ ELSE layout$ = layout$ + sp + l$
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
|
END IF
|
||||||
|
|
||||||
PRINT #12, "}"
|
PRINT #12, "}"
|
||||||
FOR i = 1 TO controlvalue(controllevel)
|
FOR i = 1 TO controlvalue(controllevel)
|
||||||
PRINT #12, "}"
|
PRINT #12, "}"
|
||||||
|
@ -6060,7 +6107,8 @@ DO
|
||||||
IF NoChecks = 0 THEN
|
IF NoChecks = 0 THEN
|
||||||
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
||||||
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -6180,9 +6228,15 @@ DO
|
||||||
controllevel = controllevel - 1
|
controllevel = controllevel - 1
|
||||||
IF EveryCaseSet(SelectCaseCounter) THEN PRINT #12, "} /* End of SELECT EVERYCASE ELSE */"
|
IF EveryCaseSet(SelectCaseCounter) THEN PRINT #12, "} /* End of SELECT EVERYCASE ELSE */"
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
PRINT #12, "sc_" + str2$(controlid(controllevel)) + "_end:;"
|
PRINT #12, "sc_" + str2$(controlid(controllevel)) + "_end:;"
|
||||||
IF controltype(controllevel) < 10 OR controltype(controllevel) > 17 THEN a$ = "END SELECT without SELECT CASE": GOTO errmes
|
IF controltype(controllevel) < 10 OR controltype(controllevel) > 17 THEN a$ = "END SELECT without SELECT CASE": GOTO errmes
|
||||||
|
|
||||||
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
|
END IF
|
||||||
|
|
||||||
IF SelectCaseCounter > 0 AND SelectCaseHasCaseBlock(SelectCaseCounter) = 0 THEN
|
IF SelectCaseCounter > 0 AND SelectCaseHasCaseBlock(SelectCaseCounter) = 0 THEN
|
||||||
'warn user of empty SELECT CASE block
|
'warn user of empty SELECT CASE block
|
||||||
IF NOT IgnoreWarnings THEN
|
IF NOT IgnoreWarnings THEN
|
||||||
|
@ -6298,7 +6352,8 @@ DO
|
||||||
IF NoChecks = 0 THEN
|
IF NoChecks = 0 THEN
|
||||||
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
PRINT #12, "S_" + str2$(statementn) + ":;": dynscope = 1
|
||||||
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -6486,7 +6541,8 @@ DO
|
||||||
|
|
||||||
IF NoChecks = 0 THEN
|
IF NoChecks = 0 THEN
|
||||||
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
IF vWatchOn = 1 AND inclinenumber(inclevel) = 0 THEN
|
||||||
PRINT #12, "do{*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "do{*__LONG_VWATCH_LINENUMBER= " + str2$(linenumber) + "; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
ELSE
|
ELSE
|
||||||
PRINT #12, "do{"
|
PRINT #12, "do{"
|
||||||
END IF
|
END IF
|
||||||
|
@ -7467,6 +7523,7 @@ DO
|
||||||
IF optionexplicit THEN a$ = "Variable '" + n$ + "' (" + symbol2fulltypename$(typ$) + ") not defined": GOTO errmes
|
IF optionexplicit THEN a$ = "Variable '" + n$ + "' (" + symbol2fulltypename$(typ$) + ") not defined": GOTO errmes
|
||||||
bypassNextVariable = -1
|
bypassNextVariable = -1
|
||||||
retval = dim2(n$, typ$, method, "")
|
retval = dim2(n$, typ$, method, "")
|
||||||
|
manageVariableList "", vWatchNewVariable$, 2
|
||||||
IF Error_Happened THEN GOTO errmes
|
IF Error_Happened THEN GOTO errmes
|
||||||
'note: variable created!
|
'note: variable created!
|
||||||
|
|
||||||
|
@ -8833,7 +8890,8 @@ DO
|
||||||
|
|
||||||
|
|
||||||
IF vWatchOn = 1 THEN
|
IF vWatchOn = 1 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
END IF
|
END IF
|
||||||
PRINT #12, "if (sub_gl_called) error(271);"
|
PRINT #12, "if (sub_gl_called) error(271);"
|
||||||
PRINT #12, "close_program=1;"
|
PRINT #12, "close_program=1;"
|
||||||
|
@ -8856,7 +8914,8 @@ DO
|
||||||
END IF
|
END IF
|
||||||
layoutdone = 1: IF LEN(layout$) THEN layout$ = layout$ + sp + l$ ELSE layout$ = l$
|
layoutdone = 1: IF LEN(layout$) THEN layout$ = layout$ + sp + l$ ELSE layout$ = l$
|
||||||
IF vWatchOn = 1 AND NoChecks = 0 THEN
|
IF vWatchOn = 1 AND NoChecks = 0 THEN
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER=-3; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
vWatchAddLabel linenumber, 0
|
||||||
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER=-3; SUB_VWATCH((ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"
|
||||||
ELSE
|
ELSE
|
||||||
PRINT #12, "close_program=1;"
|
PRINT #12, "close_program=1;"
|
||||||
PRINT #12, "end();"
|
PRINT #12, "end();"
|
||||||
|
@ -11652,18 +11711,7 @@ END IF
|
||||||
CLOSE #fh
|
CLOSE #fh
|
||||||
|
|
||||||
IF vWatchOn = 1 THEN
|
IF vWatchOn = 1 THEN
|
||||||
totalLocalVariables = 0
|
vWatchVariable "", 1
|
||||||
localVariablesList$ = ""
|
|
||||||
FOR i = 1 TO totalVariablesCreated
|
|
||||||
IF usedVariableList(i).scope = 0 THEN
|
|
||||||
totalLocalVariables = totalLocalVariables + 1
|
|
||||||
localVariablesList$ = localVariablesList$ + "vwatch_local_vars[" + str2$(totalLocalVariables - 1) + "] = &" + usedVariableList(i).cname + ";" + CRLF
|
|
||||||
END IF
|
|
||||||
NEXT
|
|
||||||
IF totalLocalVariables > 0 THEN
|
|
||||||
PRINT #13, "void *vwatch_local_vars["; totalLocalVariables; "];"
|
|
||||||
PRINT #13, localVariablesList$
|
|
||||||
END IF
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
||||||
|
@ -14009,7 +14057,7 @@ END FUNCTION
|
||||||
|
|
||||||
FUNCTION arrayreference$ (indexes$, typ)
|
FUNCTION arrayreference$ (indexes$, typ)
|
||||||
arrayprocessinghappened = 1
|
arrayprocessinghappened = 1
|
||||||
'*returns an array reference: idnumber CHR$(179) index$
|
'*returns an array reference: idnumber | index$
|
||||||
'*does not take into consideration the type of the array
|
'*does not take into consideration the type of the array
|
||||||
|
|
||||||
'*expects array id to be passed in the global id structure
|
'*expects array id to be passed in the global id structure
|
||||||
|
@ -14146,18 +14194,128 @@ SUB clearid
|
||||||
id = cleariddata
|
id = cleariddata
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
SUB vWatchVariable (this$, action AS _BYTE)
|
||||||
|
STATIC totalLocalVariables AS LONG, localVariablesList$
|
||||||
|
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
|
||||||
|
CASE 0 'add
|
||||||
|
IF INSTR(exclusions$, "@" + this$ + "@") > 0 OR LEFT$(this$, 12) = "_SUB_VWATCH_" THEN
|
||||||
|
EXIT SUB
|
||||||
|
END IF
|
||||||
|
|
||||||
|
vWatchNewVariable$ = this$
|
||||||
|
IF subfunc = "" THEN
|
||||||
|
totalMainModuleVariables = totalMainModuleVariables + 1
|
||||||
|
mainModuleVariablesList$ = mainModuleVariablesList$ + "vwatch_local_vars[" + str2$(totalMainModuleVariables - 1) + "] = &" + this$ + ";" + CRLF
|
||||||
|
ELSE
|
||||||
|
totalLocalVariables = totalLocalVariables + 1
|
||||||
|
localVariablesList$ = localVariablesList$ + "vwatch_local_vars[" + str2$(totalLocalVariables - 1) + "] = &" + this$ + ";" + CRLF
|
||||||
|
END IF
|
||||||
|
manageVariableList RTRIM$(id.cn), this$, 0
|
||||||
|
CASE 1 'dump to data[].txt & reset
|
||||||
|
IF subfunc = "" THEN
|
||||||
|
IF totalMainModuleVariables > 0 THEN
|
||||||
|
PRINT #13, "void *vwatch_local_vars["; totalMainModuleVariables; "];"
|
||||||
|
PRINT #13, mainModuleVariablesList$
|
||||||
|
ELSE
|
||||||
|
PRINT #13, "void *vwatch_local_vars[0];"
|
||||||
|
END IF
|
||||||
|
|
||||||
|
mainModuleVariablesList$ = ""
|
||||||
|
totalMainModuleVariables = 0
|
||||||
|
ELSE
|
||||||
|
IF totalLocalVariables > 0 THEN
|
||||||
|
PRINT #13, "void *vwatch_local_vars["; totalLocalVariables; "];"
|
||||||
|
PRINT #13, localVariablesList$
|
||||||
|
ELSE
|
||||||
|
PRINT #13, "void *vwatch_local_vars[0];"
|
||||||
|
END IF
|
||||||
|
|
||||||
|
localVariablesList$ = ""
|
||||||
|
totalLocalVariables = 0
|
||||||
|
END IF
|
||||||
|
END SELECT
|
||||||
|
END SUB
|
||||||
|
|
||||||
|
SUB vWatchAddLabel (this AS LONG, lastLine AS _BYTE)
|
||||||
|
STATIC prevLabel AS LONG, prevSkip AS LONG
|
||||||
|
|
||||||
|
IF lastLine = 0 THEN
|
||||||
|
WHILE this > LEN(vWatchUsedLabels)
|
||||||
|
vWatchUsedLabels = vWatchUsedLabels + SPACE$(1000)
|
||||||
|
WEND
|
||||||
|
|
||||||
|
IF firstLineNumberLabelvWatch = 0 THEN
|
||||||
|
firstLineNumberLabelvWatch = this
|
||||||
|
ELSE
|
||||||
|
IF prevSkip <> prevLabel THEN
|
||||||
|
PRINT #12, "VWATCH_SKIPLABEL_" + str2$(prevLabel) + ":;"
|
||||||
|
prevSkip = prevLabel
|
||||||
|
END IF
|
||||||
|
END IF
|
||||||
|
|
||||||
|
IF prevLabel <> this THEN
|
||||||
|
ASC(vWatchUsedLabels, this) = 1
|
||||||
|
PRINT #12, "VWATCH_LABEL_" + str2$(this) + ":;"
|
||||||
|
prevLabel = this
|
||||||
|
lastLineNumberLabelvWatch = this
|
||||||
|
END IF
|
||||||
|
ELSE
|
||||||
|
IF prevSkip <> prevLabel THEN
|
||||||
|
PRINT #12, "VWATCH_SKIPLABEL_" + str2$(prevLabel) + ":;"
|
||||||
|
prevSkip = prevLabel
|
||||||
|
END IF
|
||||||
|
END IF
|
||||||
|
END SUB
|
||||||
|
|
||||||
SUB closemain
|
SUB closemain
|
||||||
xend
|
xend
|
||||||
|
|
||||||
PRINT #12, "return;"
|
PRINT #12, "return;"
|
||||||
|
|
||||||
|
IF vWatchOn AND firstLineNumberLabelvWatch > 0 THEN
|
||||||
|
PRINT #12, "VWATCH_SETNEXTLINE:;"
|
||||||
|
PRINT #12, "switch (*__LONG_VWATCH_GOTO) {"
|
||||||
|
FOR i = firstLineNumberLabelvWatch TO lastLineNumberLabelvWatch
|
||||||
|
IF ASC(vWatchUsedLabels, i) = 1 THEN
|
||||||
|
PRINT #12, " case " + str2$(i) + ":"
|
||||||
|
PRINT #12, " goto VWATCH_LABEL_" + str2$(i) + ";"
|
||||||
|
PRINT #12, " break;"
|
||||||
|
END IF
|
||||||
|
NEXT
|
||||||
|
PRINT #12, " default:"
|
||||||
|
PRINT #12, " *__LONG_VWATCH_GOTO=*__LONG_VWATCH_LINENUMBER;"
|
||||||
|
PRINT #12, " goto VWATCH_SETNEXTLINE;"
|
||||||
|
PRINT #12, "}"
|
||||||
|
|
||||||
|
PRINT #12, "VWATCH_SKIPLINE:;"
|
||||||
|
PRINT #12, "switch (*__LONG_VWATCH_GOTO) {"
|
||||||
|
FOR i = firstLineNumberLabelvWatch TO lastLineNumberLabelvWatch
|
||||||
|
IF ASC(vWatchUsedLabels, i) = 1 THEN
|
||||||
|
PRINT #12, " case -" + str2$(i) + ":"
|
||||||
|
PRINT #12, " goto VWATCH_SKIPLABEL_" + str2$(i) + ";"
|
||||||
|
PRINT #12, " break;"
|
||||||
|
END IF
|
||||||
|
NEXT
|
||||||
|
PRINT #12, "}"
|
||||||
|
|
||||||
|
END IF
|
||||||
|
|
||||||
PRINT #12, "}"
|
PRINT #12, "}"
|
||||||
PRINT #15, "}" 'end case
|
PRINT #15, "}" 'end case
|
||||||
PRINT #15, "}"
|
PRINT #15, "}"
|
||||||
PRINT #15, "error(3);" 'no valid return possible
|
PRINT #15, "error(3);" 'no valid return possible
|
||||||
|
|
||||||
closedmain = 1
|
closedmain = 1
|
||||||
|
firstLineNumberLabelvWatch = 0
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
FUNCTION countelements (a$)
|
FUNCTION countelements (a$)
|
||||||
|
@ -14284,6 +14442,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
id.arrayelements = nume
|
id.arrayelements = nume
|
||||||
id.callname = n$
|
id.callname = n$
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14321,6 +14480,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14487,6 +14647,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
id.musthave = "$" + str2(bytes)
|
id.musthave = "$" + str2(bytes)
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14577,6 +14738,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
id.musthave = "$"
|
id.musthave = "$"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14680,6 +14842,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
IF unsgn THEN id.musthave = "~`" + str2(bits) ELSE id.musthave = "`" + str2(bits)
|
IF unsgn THEN id.musthave = "~`" + str2(bits) ELSE id.musthave = "`" + str2(bits)
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14765,6 +14928,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
IF unsgn THEN id.musthave = "~%%" ELSE id.musthave = "%%"
|
IF unsgn THEN id.musthave = "~%%" ELSE id.musthave = "%%"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14847,6 +15011,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
IF unsgn THEN id.musthave = "~%" ELSE id.musthave = "%"
|
IF unsgn THEN id.musthave = "~%" ELSE id.musthave = "%"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -14934,6 +15099,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
IF unsgn THEN id.musthave = "~%&" ELSE id.musthave = "%&"
|
IF unsgn THEN id.musthave = "~%&" ELSE id.musthave = "%&"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -15018,6 +15184,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
IF unsgn THEN id.musthave = "~&" ELSE id.musthave = "&"
|
IF unsgn THEN id.musthave = "~&" ELSE id.musthave = "&"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -15102,6 +15269,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
IF unsgn THEN id.musthave = "~&&" ELSE id.musthave = "&&"
|
IF unsgn THEN id.musthave = "~&&" ELSE id.musthave = "&&"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -15186,6 +15354,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
id.musthave = "!"
|
id.musthave = "!"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -15268,6 +15437,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
id.musthave = "#"
|
id.musthave = "#"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -15350,6 +15520,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
id.musthave = "##"
|
id.musthave = "##"
|
||||||
END IF
|
END IF
|
||||||
regid
|
regid
|
||||||
|
vWatchVariable n$, 0
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
GOTO dim2exitfunc
|
GOTO dim2exitfunc
|
||||||
END IF
|
END IF
|
||||||
|
@ -15357,9 +15528,6 @@ FUNCTION dim2 (varname$, typ2$, method, elements$)
|
||||||
Give_Error "Unknown type": EXIT FUNCTION
|
Give_Error "Unknown type": EXIT FUNCTION
|
||||||
dim2exitfunc:
|
dim2exitfunc:
|
||||||
|
|
||||||
IF bypassNextVariable = 0 THEN
|
|
||||||
manageVariableList cvarname$, n$, 0
|
|
||||||
END IF
|
|
||||||
bypassNextVariable = 0
|
bypassNextVariable = 0
|
||||||
|
|
||||||
IF dimsfarray THEN
|
IF dimsfarray THEN
|
||||||
|
@ -15450,7 +15618,7 @@ FUNCTION udtreference$ (o$, a$, typ AS LONG)
|
||||||
GOTO udtfindelenext
|
GOTO udtfindelenext
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
'Change e reference to u CHR$(179) 0 reference?
|
'Change e reference to u | 0 reference?
|
||||||
IF udtetype(E) AND ISUDT THEN
|
IF udtetype(E) AND ISUDT THEN
|
||||||
u = udtetype(E) AND 511
|
u = udtetype(E) AND 511
|
||||||
E = 0
|
E = 0
|
||||||
|
@ -15950,6 +16118,7 @@ FUNCTION evaluate$ (a2$, typ AS LONG)
|
||||||
IF optionexplicit THEN Give_Error "Variable '" + x$ + "' (" + symbol2fulltypename$(typ$) + ") not defined": EXIT FUNCTION
|
IF optionexplicit THEN Give_Error "Variable '" + x$ + "' (" + symbol2fulltypename$(typ$) + ") not defined": EXIT FUNCTION
|
||||||
bypassNextVariable = -1
|
bypassNextVariable = -1
|
||||||
retval = dim2(x$, typ$, 1, "")
|
retval = dim2(x$, typ$, 1, "")
|
||||||
|
manageVariableList "", vWatchNewVariable$, 3
|
||||||
IF Error_Happened THEN EXIT FUNCTION
|
IF Error_Happened THEN EXIT FUNCTION
|
||||||
|
|
||||||
simplevarfound:
|
simplevarfound:
|
||||||
|
@ -18286,7 +18455,7 @@ FUNCTION findid& (n2$)
|
||||||
''' END IF 'safeguard
|
''' END IF 'safeguard
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
'optomizations for later comparisons
|
'optimizations for later comparisons
|
||||||
insf$ = subfunc + SPACE$(256 - LEN(subfunc))
|
insf$ = subfunc + SPACE$(256 - LEN(subfunc))
|
||||||
secondarg$ = secondarg$ + SPACE$(256 - LEN(secondarg$))
|
secondarg$ = secondarg$ + SPACE$(256 - LEN(secondarg$))
|
||||||
IF LEN(sc$) THEN scpassed = 1: sc$ = sc$ + SPACE$(8 - LEN(sc$)) ELSE scpassed = 0
|
IF LEN(sc$) THEN scpassed = 1: sc$ = sc$ + SPACE$(8 - LEN(sc$)) ELSE scpassed = 0
|
||||||
|
@ -18390,33 +18559,8 @@ FUNCTION findid& (n2$)
|
||||||
id = ids(i)
|
id = ids(i)
|
||||||
|
|
||||||
t = id.t
|
t = id.t
|
||||||
IF id.subfunc = 0 THEN
|
temp$ = refer$(str2$(i), t, 1)
|
||||||
IF t = 0 THEN
|
manageVariableList "", temp$, 1
|
||||||
t = id.arraytype
|
|
||||||
IF t AND ISUDT THEN
|
|
||||||
manageVariableList "", scope$ + "ARRAY_UDT_" + RTRIM$(id.n), 1
|
|
||||||
ELSE
|
|
||||||
n$ = id2shorttypename$
|
|
||||||
IF LEFT$(n$, 1) = "_" THEN
|
|
||||||
manageVariableList "", scope$ + "ARRAY" + n$ + "_" + RTRIM$(id.n), 2
|
|
||||||
ELSE
|
|
||||||
manageVariableList "", scope$ + "ARRAY_" + n$ + "_" + RTRIM$(id.n), 3
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
ELSE
|
|
||||||
IF t AND ISUDT THEN
|
|
||||||
manageVariableList "", scope$ + "UDT_" + RTRIM$(id.n), 4
|
|
||||||
ELSE
|
|
||||||
n$ = id2shorttypename$
|
|
||||||
IF LEFT$(n$, 1) = "_" THEN
|
|
||||||
'manageVariableList "", scope$ + MID$(n$, 2) + "_" + RTRIM$(id.n), 5
|
|
||||||
ELSE
|
|
||||||
manageVariableList "", scope$ + n$ + "_" + RTRIM$(id.n), 6
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
|
|
||||||
currentid = i
|
currentid = i
|
||||||
EXIT FUNCTION
|
EXIT FUNCTION
|
||||||
|
|
||||||
|
@ -19617,7 +19761,7 @@ FUNCTION isvalidvariable (a$)
|
||||||
NEXT
|
NEXT
|
||||||
|
|
||||||
isvalidvariable = 1
|
isvalidvariable = 1
|
||||||
IF i > n THEN EXIT FUNCTION
|
IF i > n THEN EXIT FUNCTION 'i is always greater than n because n is undefined here. Why didn't I remove this line and the ones below it, which will never run? Cause I'm a coward. F.h.
|
||||||
e$ = RIGHT$(a$, LEN(a$) - i - 1)
|
e$ = RIGHT$(a$, LEN(a$) - i - 1)
|
||||||
IF e$ = "%%" OR e$ = "~%%" THEN EXIT FUNCTION
|
IF e$ = "%%" OR e$ = "~%%" THEN EXIT FUNCTION
|
||||||
IF e$ = "%" OR e$ = "~%" THEN EXIT FUNCTION
|
IF e$ = "%" OR e$ = "~%" THEN EXIT FUNCTION
|
||||||
|
@ -21952,7 +22096,6 @@ SUB setrefer (a2$, typ2 AS LONG, e2$, method AS LONG)
|
||||||
directudt:
|
directudt:
|
||||||
IF u <> u2 OR e2 <> 0 THEN Give_Error "Expected = similar user defined type": EXIT SUB
|
IF u <> u2 OR e2 <> 0 THEN Give_Error "Expected = similar user defined type": EXIT SUB
|
||||||
dst$ = "((char*)" + lhsscope$ + n$ + ")+(" + o$ + ")"
|
dst$ = "((char*)" + lhsscope$ + n$ + ")+(" + o$ + ")"
|
||||||
|
|
||||||
copy_full_udt dst$, src$, 12, 0, u
|
copy_full_udt dst$, src$, 12, 0, u
|
||||||
|
|
||||||
'print "setFULLUDTrefer!"
|
'print "setFULLUDTrefer!"
|
||||||
|
@ -21989,7 +22132,6 @@ SUB setrefer (a2$, typ2 AS LONG, e2$, method AS LONG)
|
||||||
'print "setUDTrefer:"+r$,e$
|
'print "setUDTrefer:"+r$,e$
|
||||||
tlayout$ = tl$
|
tlayout$ = tl$
|
||||||
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
||||||
manageVariableList "", scope$ + n$, 7
|
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -22024,7 +22166,6 @@ SUB setrefer (a2$, typ2 AS LONG, e2$, method AS LONG)
|
||||||
PRINT #12, cleanupstringprocessingcall$ + "0);"
|
PRINT #12, cleanupstringprocessingcall$ + "0);"
|
||||||
tlayout$ = tl$
|
tlayout$ = tl$
|
||||||
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
||||||
manageVariableList "", r$, 8
|
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -22100,7 +22241,6 @@ SUB setrefer (a2$, typ2 AS LONG, e2$, method AS LONG)
|
||||||
IF arrayprocessinghappened THEN arrayprocessinghappened = 0
|
IF arrayprocessinghappened THEN arrayprocessinghappened = 0
|
||||||
tlayout$ = tl$
|
tlayout$ = tl$
|
||||||
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
||||||
manageVariableList "", r$, 9
|
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -22132,7 +22272,6 @@ SUB setrefer (a2$, typ2 AS LONG, e2$, method AS LONG)
|
||||||
IF arrayprocessinghappened THEN arrayprocessinghappened = 0
|
IF arrayprocessinghappened THEN arrayprocessinghappened = 0
|
||||||
tlayout$ = tl$
|
tlayout$ = tl$
|
||||||
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
||||||
manageVariableList "", r$, 10
|
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -22161,8 +22300,6 @@ SUB setrefer (a2$, typ2 AS LONG, e2$, method AS LONG)
|
||||||
tlayout$ = tl$
|
tlayout$ = tl$
|
||||||
|
|
||||||
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
IF LEFT$(r$, 1) = "*" THEN r$ = MID$(r$, 2)
|
||||||
manageVariableList "", r$, 11
|
|
||||||
|
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF 'variable
|
END IF 'variable
|
||||||
|
|
||||||
|
@ -22206,7 +22343,7 @@ FUNCTION typ2ctyp$ (t AS LONG, tstr AS STRING)
|
||||||
IF b = 16 THEN ctyp$ = "int16"
|
IF b = 16 THEN ctyp$ = "int16"
|
||||||
IF b = 32 THEN ctyp$ = "int32"
|
IF b = 32 THEN ctyp$ = "int32"
|
||||||
IF b = 64 THEN ctyp$ = "int64"
|
IF b = 64 THEN ctyp$ = "int64"
|
||||||
IF typ AND ISOFFSET THEN ctyp$ = "ptrszint"
|
IF t AND ISOFFSET THEN ctyp$ = "ptrszint"
|
||||||
IF (t AND ISUNSIGNED) THEN ctyp$ = "u" + ctyp$
|
IF (t AND ISUNSIGNED) THEN ctyp$ = "u" + ctyp$
|
||||||
END IF
|
END IF
|
||||||
IF t AND ISOFFSET THEN
|
IF t AND ISOFFSET THEN
|
||||||
|
@ -22617,6 +22754,7 @@ END FUNCTION
|
||||||
|
|
||||||
SUB xend
|
SUB xend
|
||||||
IF vWatchOn = 1 THEN
|
IF vWatchOn = 1 THEN
|
||||||
|
vWatchAddLabel 0, -1
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_local_vars);"
|
||||||
END IF
|
END IF
|
||||||
PRINT #12, "sub_end();"
|
PRINT #12, "sub_end();"
|
||||||
|
@ -25712,8 +25850,9 @@ SUB dump_udts
|
||||||
CLOSE #f
|
CLOSE #f
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB manageVariableList (name$, __cname$, action AS _BYTE)
|
SUB manageVariableList (__name$, __cname$, action AS _BYTE)
|
||||||
DIM findItem AS LONG, cname$, i AS LONG
|
DIM findItem AS LONG, cname$, i AS LONG, name$
|
||||||
|
name$ = __name$
|
||||||
cname$ = __cname$
|
cname$ = __cname$
|
||||||
|
|
||||||
IF LEN(cname$) = 0 THEN EXIT SUB
|
IF LEN(cname$) = 0 THEN EXIT SUB
|
||||||
|
@ -25748,15 +25887,13 @@ SUB manageVariableList (name$, __cname$, action AS _BYTE)
|
||||||
END IF
|
END IF
|
||||||
usedVariableList(i).scope = subfuncn
|
usedVariableList(i).scope = subfuncn
|
||||||
usedVariableList(i).cname = cname$
|
usedVariableList(i).cname = cname$
|
||||||
|
IF LEN(RTRIM$(id.musthave)) > 0 THEN name$ = name$ + RTRIM$(id.musthave)
|
||||||
usedVariableList(i).name = name$
|
usedVariableList(i).name = name$
|
||||||
totalVariablesCreated = totalVariablesCreated + 1
|
totalVariablesCreated = totalVariablesCreated + 1
|
||||||
END IF
|
END IF
|
||||||
CASE ELSE 'find and mark as used
|
CASE ELSE 'find and mark as used
|
||||||
IF found THEN
|
IF found THEN
|
||||||
usedVariableList(i).used = -1
|
usedVariableList(i).used = -1
|
||||||
ELSE
|
|
||||||
manageVariableList name$, __cname$, 0
|
|
||||||
manageVariableList name$, __cname$, 12
|
|
||||||
END IF
|
END IF
|
||||||
END SELECT
|
END SELECT
|
||||||
END SUB
|
END SUB
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
$CHECKING:OFF
|
$CHECKING:OFF
|
||||||
DIM SHARED AS LONG vwatch_linenumber, vwatch_sublevel
|
DIM SHARED AS LONG vwatch_linenumber, vwatch_sublevel, vwatch_goto
|
||||||
DIM SHARED AS STRING vwatch_subname, vwatch_callstack
|
DIM SHARED AS STRING vwatch_subname, vwatch_callstack
|
||||||
REDIM SHARED vwatch_breakpoints(0) AS _BYTE
|
REDIM SHARED vwatch_breakpoints(0) AS _BYTE
|
||||||
|
REDIM SHARED vwatch_skiplines(0) AS _BYTE
|
||||||
'next lines are just to avoid "unused variable" warnings:
|
'next lines are just to avoid "unused variable" warnings:
|
||||||
vwatch_linenumber = 0
|
vwatch_linenumber = 0
|
||||||
vwatch_sublevel = 0
|
vwatch_sublevel = 0
|
||||||
|
vwatch_goto = 0
|
||||||
vwatch_breakpoints(0) = 0
|
vwatch_breakpoints(0) = 0
|
||||||
|
vwatch_skiplines(0) = 0
|
||||||
vwatch_subname = ""
|
vwatch_subname = ""
|
||||||
vwatch_callstack = ""
|
vwatch_callstack = ""
|
||||||
$CHECKING:ON
|
$CHECKING:ON
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
$CHECKING:OFF
|
$CHECKING:OFF
|
||||||
|
|
||||||
SUB vwatch (localVariables AS _OFFSET)
|
SUB vwatch (localVariables AS _OFFSET)
|
||||||
STATIC AS LONG ide, breakpointCount, timeout, startLevel, lastLine
|
STATIC AS LONG ideHost, breakpointCount, skipCount, timeout, startLevel, lastLine
|
||||||
STATIC AS LONG callStackLength
|
STATIC AS LONG callStackLength, runToLine
|
||||||
STATIC AS _BYTE pauseMode, stepOver, bypass
|
STATIC AS _BYTE pauseMode, stepOver, bypass, setNextLine
|
||||||
STATIC buffer$, endc$
|
STATIC buffer$, endc$
|
||||||
DIM AS LONG i
|
DIM AS LONG i
|
||||||
DIM AS _OFFSET address
|
DIM AS _OFFSET address
|
||||||
|
@ -17,7 +17,9 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
|
|
||||||
IF bypass THEN EXIT SUB
|
IF bypass THEN EXIT SUB
|
||||||
|
|
||||||
IF ide = 0 THEN
|
vwatch_goto = 0
|
||||||
|
|
||||||
|
IF ideHost = 0 THEN
|
||||||
timeout = 10
|
timeout = 10
|
||||||
endc$ = "<END>"
|
endc$ = "<END>"
|
||||||
|
|
||||||
|
@ -33,19 +35,20 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
SELECT CASE cmd$
|
SELECT CASE cmd$
|
||||||
CASE "vwatch"
|
CASE "vwatch"
|
||||||
IF value$ <> "ok" THEN
|
IF value$ <> "ok" THEN
|
||||||
CLOSE #ide
|
CLOSE #ideHost
|
||||||
bypass = -1
|
bypass = -1
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
CASE "line count"
|
CASE "line count"
|
||||||
REDIM vwatch_breakpoints(CVL(value$)) AS _BYTE
|
REDIM vwatch_breakpoints(CVL(value$)) AS _BYTE
|
||||||
|
REDIM vwatch_skiplines(CVL(value$)) AS _BYTE
|
||||||
CASE "breakpoint count"
|
CASE "breakpoint count"
|
||||||
breakpointCount = CVL(value$)
|
breakpointCount = CVL(value$)
|
||||||
CASE "breakpoint list"
|
CASE "breakpoint list"
|
||||||
IF LEN(value$) \ 4 <> breakpointCount THEN
|
IF LEN(value$) \ 4 <> breakpointCount THEN
|
||||||
cmd$ = "quit:Communication error."
|
cmd$ = "quit:Communication error."
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
CLOSE #ide
|
CLOSE #ideHost
|
||||||
bypass = -1
|
bypass = -1
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
@ -53,6 +56,20 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
temp$ = MID$(value$, i * 4 - 3, 4)
|
temp$ = MID$(value$, i * 4 - 3, 4)
|
||||||
vwatch_breakpoints(CVL(temp$)) = -1
|
vwatch_breakpoints(CVL(temp$)) = -1
|
||||||
NEXT
|
NEXT
|
||||||
|
CASE "skip count"
|
||||||
|
skipCount = CVL(value$)
|
||||||
|
CASE "skip list"
|
||||||
|
IF LEN(value$) \ 4 <> skipCount THEN
|
||||||
|
cmd$ = "quit:Communication error."
|
||||||
|
GOSUB SendCommand
|
||||||
|
CLOSE #ideHost
|
||||||
|
bypass = -1
|
||||||
|
EXIT SUB
|
||||||
|
END IF
|
||||||
|
FOR i = 1 TO skipCount
|
||||||
|
temp$ = MID$(value$, i * 4 - 3, 4)
|
||||||
|
vwatch_skiplines(CVL(temp$)) = -1
|
||||||
|
NEXT
|
||||||
CASE "run"
|
CASE "run"
|
||||||
IF vwatch_breakpoints(vwatch_linenumber) THEN EXIT DO
|
IF vwatch_breakpoints(vwatch_linenumber) THEN EXIT DO
|
||||||
pauseMode = 0
|
pauseMode = 0
|
||||||
|
@ -65,18 +82,16 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF vwatch_linenumber = 0 THEN
|
IF vwatch_linenumber = 0 THEN
|
||||||
cmd$ = "call stack size:" + MKL$(callStackLength)
|
GOSUB SendCallStack
|
||||||
GOSUB SendCommand
|
|
||||||
cmd$ = "call stack:" + vwatch_callstack
|
|
||||||
GOSUB SendCommand
|
|
||||||
cmd$ = "quit:Program ended."
|
cmd$ = "quit:Program ended."
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
CLOSE #ide
|
CLOSE #ideHost
|
||||||
bypass = -1
|
bypass = -1
|
||||||
ide = 0
|
ideHost = 0
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
ELSEIF vwatch_linenumber = -1 THEN
|
ELSEIF vwatch_linenumber = -1 THEN
|
||||||
'report an error in the most recent line
|
'report an error in the most recent line
|
||||||
|
GOSUB SendCallStack
|
||||||
cmd$ = "error:" + MKL$(lastLine)
|
cmd$ = "error:" + MKL$(lastLine)
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
|
@ -97,7 +112,8 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF vwatch_linenumber = lastLine THEN EXIT SUB
|
IF vwatch_linenumber = lastLine AND setNextLine = 0 THEN EXIT SUB
|
||||||
|
setNextLine = 0
|
||||||
lastLine = vwatch_linenumber
|
lastLine = vwatch_linenumber
|
||||||
|
|
||||||
GOSUB GetCommand
|
GOSUB GetCommand
|
||||||
|
@ -105,15 +121,24 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
CASE "break"
|
CASE "break"
|
||||||
pauseMode = -1
|
pauseMode = -1
|
||||||
stepOver = 0
|
stepOver = 0
|
||||||
|
runToLine = 0
|
||||||
cmd$ = ""
|
cmd$ = ""
|
||||||
CASE "set breakpoint"
|
CASE "set breakpoint"
|
||||||
vwatch_breakpoints(CVL(value$)) = -1
|
vwatch_breakpoints(CVL(value$)) = -1
|
||||||
|
vwatch_skiplines(CVL(value$)) = 0
|
||||||
CASE "clear breakpoint"
|
CASE "clear breakpoint"
|
||||||
vwatch_breakpoints(CVL(value$)) = 0
|
vwatch_breakpoints(CVL(value$)) = 0
|
||||||
|
CASE "set skip line"
|
||||||
|
vwatch_skiplines(CVL(value$)) = -1
|
||||||
|
vwatch_breakpoints(CVL(value$)) = 0
|
||||||
|
CASE "clear skip line"
|
||||||
|
vwatch_skiplines(CVL(value$)) = 0
|
||||||
CASE "clear all breakpoints"
|
CASE "clear all breakpoints"
|
||||||
REDIM vwatch_breakpoints(UBOUND(vwatch_breakpoints)) AS _BYTE
|
REDIM vwatch_breakpoints(UBOUND(vwatch_breakpoints)) AS _BYTE
|
||||||
END SELECT
|
END SELECT
|
||||||
|
|
||||||
|
IF vwatch_skiplines(vwatch_linenumber) THEN vwatch_goto = -vwatch_linenumber: EXIT SUB
|
||||||
|
|
||||||
IF stepOver = -1 AND vwatch_sublevel > startLevel AND vwatch_breakpoints(vwatch_linenumber) = 0 THEN
|
IF stepOver = -1 AND vwatch_sublevel > startLevel AND vwatch_breakpoints(vwatch_linenumber) = 0 THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
ELSEIF stepOver = -1 AND vwatch_sublevel = startLevel THEN
|
ELSEIF stepOver = -1 AND vwatch_sublevel = startLevel THEN
|
||||||
|
@ -121,6 +146,13 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
pauseMode = -1
|
pauseMode = -1
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
IF runToLine > 0 AND runToLine <> vwatch_linenumber THEN
|
||||||
|
EXIT SUB
|
||||||
|
ELSEIF runToLine > 0 AND runToLine = vwatch_linenumber THEN
|
||||||
|
pauseMode = -1
|
||||||
|
runToLine = 0
|
||||||
|
END IF
|
||||||
|
|
||||||
IF vwatch_breakpoints(vwatch_linenumber) = 0 AND pauseMode = 0 THEN
|
IF vwatch_breakpoints(vwatch_linenumber) = 0 AND pauseMode = 0 THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
@ -138,6 +170,12 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
stepOver = 0
|
stepOver = 0
|
||||||
vwatch_starttimers
|
vwatch_starttimers
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
|
CASE "run to line"
|
||||||
|
pauseMode = 0
|
||||||
|
stepOver = 0
|
||||||
|
runToLine = CVL(value$)
|
||||||
|
vwatch_starttimers
|
||||||
|
EXIT SUB
|
||||||
CASE "step"
|
CASE "step"
|
||||||
pauseMode = -1
|
pauseMode = -1
|
||||||
stepOver = 0
|
stepOver = 0
|
||||||
|
@ -155,27 +193,36 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
vwatch_starttimers
|
vwatch_starttimers
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
CASE "free"
|
CASE "free"
|
||||||
CLOSE #ide
|
CLOSE #ideHost
|
||||||
ide = 0
|
ideHost = 0
|
||||||
bypass = -1
|
bypass = -1
|
||||||
vwatch_starttimers
|
vwatch_starttimers
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
CASE "set breakpoint"
|
CASE "set breakpoint"
|
||||||
vwatch_breakpoints(CVL(value$)) = -1
|
vwatch_breakpoints(CVL(value$)) = -1
|
||||||
|
vwatch_skiplines(CVL(value$)) = 0
|
||||||
CASE "clear breakpoint"
|
CASE "clear breakpoint"
|
||||||
vwatch_breakpoints(CVL(value$)) = 0
|
vwatch_breakpoints(CVL(value$)) = 0
|
||||||
CASE "clear all breakpoints"
|
CASE "clear all breakpoints"
|
||||||
REDIM vwatch_breakpoints(UBOUND(vwatch_breakpoints)) AS _BYTE
|
REDIM vwatch_breakpoints(UBOUND(vwatch_breakpoints)) AS _BYTE
|
||||||
CASE "call stack"
|
CASE "call stack"
|
||||||
'send call stack history"
|
'send call stack history"
|
||||||
cmd$ = "call stack size:" + MKL$(callStackLength)
|
GOSUB SendCallStack
|
||||||
GOSUB SendCommand
|
|
||||||
cmd$ = "call stack:" + vwatch_callstack
|
|
||||||
GOSUB SendCommand
|
|
||||||
CASE "local"
|
CASE "local"
|
||||||
i = CVL(value$)
|
i = CVL(value$)
|
||||||
address = localVariables + LEN(address) * i
|
address = localVariables + LEN(address) * i
|
||||||
PRINT "Local"; i; "is at"; _MEMGET(m, address, _OFFSET)
|
PRINT "Local"; i; "is at"; _MEMGET(m, address, _OFFSET)
|
||||||
|
CASE "set next line"
|
||||||
|
pauseMode = -1
|
||||||
|
stepOver = 0
|
||||||
|
setNextLine = -1
|
||||||
|
vwatch_goto = CVL(value$)
|
||||||
|
EXIT SUB
|
||||||
|
CASE "set skip line"
|
||||||
|
vwatch_skiplines(CVL(value$)) = -1
|
||||||
|
vwatch_breakpoints(CVL(value$)) = 0
|
||||||
|
CASE "clear skip line"
|
||||||
|
vwatch_skiplines(CVL(value$)) = 0
|
||||||
END SELECT
|
END SELECT
|
||||||
|
|
||||||
GOSUB GetCommand
|
GOSUB GetCommand
|
||||||
|
@ -186,20 +233,21 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
|
|
||||||
Connect:
|
Connect:
|
||||||
|
DIM ideport$
|
||||||
ideport$ = ENVIRON$("QB64DEBUGPORT")
|
ideport$ = ENVIRON$("QB64DEBUGPORT")
|
||||||
IF ideport$ = "" THEN bypass = -1: EXIT SUB
|
IF ideport$ = "" THEN bypass = -1: EXIT SUB
|
||||||
|
|
||||||
start! = TIMER
|
start! = TIMER
|
||||||
DO
|
DO
|
||||||
k& = _KEYHIT
|
k& = _KEYHIT
|
||||||
ide = _OPENCLIENT("TCP/IP:" + ideport$ + ":localhost")
|
ideHost = _OPENCLIENT("TCP/IP:" + ideport$ + ":localhost")
|
||||||
_LIMIT 30
|
_LIMIT 30
|
||||||
LOOP UNTIL k& = 27 OR ide <> 0 OR TIMER - start! > timeout
|
LOOP UNTIL k& = 27 OR ideHost <> 0 OR TIMER - start! > timeout
|
||||||
IF ide = 0 THEN bypass = -1: EXIT SUB
|
IF ideHost = 0 THEN bypass = -1: EXIT SUB
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
GetCommand:
|
GetCommand:
|
||||||
GET #ide, , temp$
|
GET #ideHost, , temp$
|
||||||
buffer$ = buffer$ + temp$
|
buffer$ = buffer$ + temp$
|
||||||
|
|
||||||
IF INSTR(buffer$, endc$) THEN
|
IF INSTR(buffer$, endc$) THEN
|
||||||
|
@ -217,9 +265,16 @@ SUB vwatch (localVariables AS _OFFSET)
|
||||||
END IF
|
END IF
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
|
SendCallStack:
|
||||||
|
cmd$ = "call stack size:" + MKL$(callStackLength)
|
||||||
|
GOSUB SendCommand
|
||||||
|
cmd$ = "call stack:" + vwatch_callstack
|
||||||
|
GOSUB SendCommand
|
||||||
|
RETURN
|
||||||
|
|
||||||
SendCommand:
|
SendCommand:
|
||||||
cmd$ = cmd$ + endc$
|
cmd$ = cmd$ + endc$
|
||||||
PUT #ide, , cmd$
|
PUT #ideHost, , cmd$
|
||||||
cmd$ = ""
|
cmd$ = ""
|
||||||
RETURN
|
RETURN
|
||||||
END SUB
|
END SUB
|
||||||
|
|
Loading…
Reference in a new issue