mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-22 11:25:08 +00:00
Allows local variables to be watched (still a bit broken).
This commit is contained in:
parent
426b26b002
commit
a2a49cef01
4 changed files with 19 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
$CHECKING:OFF
|
$CHECKING:OFF
|
||||||
DIM SHARED AS LONG vwatch_linenumber, vwatch_sublevel, vwatch_goto
|
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_internalsubname, vwatch_callstack
|
||||||
REDIM SHARED vwatch_breakpoints(0) AS _BYTE
|
REDIM SHARED vwatch_breakpoints(0) AS _BYTE
|
||||||
REDIM SHARED vwatch_skiplines(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:
|
||||||
|
@ -10,5 +10,6 @@ vwatch_goto = 0
|
||||||
vwatch_breakpoints(0) = 0
|
vwatch_breakpoints(0) = 0
|
||||||
vwatch_skiplines(0) = 0
|
vwatch_skiplines(0) = 0
|
||||||
vwatch_subname = ""
|
vwatch_subname = ""
|
||||||
|
vwatch_internalsubname = ""
|
||||||
vwatch_callstack = ""
|
vwatch_callstack = ""
|
||||||
$CHECKING:ON
|
$CHECKING:ON
|
||||||
|
|
|
@ -166,7 +166,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
cmd$ = cmd$ + MKL$(vwatch_linenumber)
|
cmd$ = cmd$ + MKL$(vwatch_linenumber)
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
IF vwatch_sublevel > 1 THEN
|
IF vwatch_sublevel > 1 THEN
|
||||||
cmd$ = "current sub:" + vwatch_subname$
|
cmd$ = "current sub:" + vwatch_internalsubname$
|
||||||
ELSE
|
ELSE
|
||||||
cmd$ = "current sub:"
|
cmd$ = "current sub:"
|
||||||
END IF
|
END IF
|
||||||
|
@ -226,6 +226,8 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
address = globalVariables + LEN(address) * localIndex
|
address = globalVariables + LEN(address) * localIndex
|
||||||
address = _MEMGET(m, address, _OFFSET)
|
address = _MEMGET(m, address, _OFFSET)
|
||||||
GOSUB GetMemData
|
GOSUB GetMemData
|
||||||
|
$CONSOLE
|
||||||
|
_ECHO "Sending global var: " + STR$(tempIndex) + " = " + result$
|
||||||
cmd$ = "global var:" + MKL$(tempIndex) + result$
|
cmd$ = "global var:" + MKL$(tempIndex) + result$
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
CASE "local var"
|
CASE "local var"
|
||||||
|
@ -234,10 +236,12 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
dataType$ = MID$(value$, 9)
|
dataType$ = MID$(value$, 9)
|
||||||
address = localVariables + LEN(address) * localIndex
|
address = localVariables + LEN(address) * localIndex
|
||||||
address = _MEMGET(m, address, _OFFSET)
|
address = _MEMGET(m, address, _OFFSET)
|
||||||
|
GOSUB GetMemData
|
||||||
|
_ECHO "Sending local var: " + STR$(tempIndex) + " = " + result$
|
||||||
cmd$ = "local var:" + MKL$(tempIndex) + result$
|
cmd$ = "local var:" + MKL$(tempIndex) + result$
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
CASE "current sub"
|
CASE "current sub"
|
||||||
cmd$ = "current sub:" + vwatch_subname$
|
cmd$ = "current sub:" + vwatch_internalsubname$
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
CASE "set next line"
|
CASE "set next line"
|
||||||
pauseMode = -1
|
pauseMode = -1
|
||||||
|
|
|
@ -6940,12 +6940,17 @@ SUB DebugMode
|
||||||
temp$ = MID$(temp$, 5)
|
temp$ = MID$(temp$, 5)
|
||||||
IF usedVariableList(tempIndex&).watch THEN
|
IF usedVariableList(tempIndex&).watch THEN
|
||||||
cmd$ = ""
|
cmd$ = ""
|
||||||
|
_ECHO "usedVariableList(tempIndex&).subfunc =" + usedVariableList(tempIndex&).subfunc
|
||||||
|
_ECHO "currentSub$ =" + currentSub$
|
||||||
IF LEN(usedVariableList(tempIndex&).subfunc) = 0 THEN
|
IF LEN(usedVariableList(tempIndex&).subfunc) = 0 THEN
|
||||||
cmd$ = "global var:"
|
cmd$ = "global var:"
|
||||||
ELSEIF usedVariableList(tempIndex&).subfunc = currentSub$ THEN
|
ELSEIF usedVariableList(tempIndex&).subfunc = currentSub$ THEN
|
||||||
cmd$ = "local var:"
|
cmd$ = "local var:"
|
||||||
END IF
|
END IF
|
||||||
IF LEN(cmd$) THEN
|
IF LEN(cmd$) THEN
|
||||||
|
_CONSOLE ON
|
||||||
|
_ECHO "Requesting " + cmd$
|
||||||
|
_ECHO "currentSub$ = " + currentSub$
|
||||||
cmd$ = cmd$ + MKL$(tempIndex&) + MKL$(usedVariableList(tempIndex&).localIndex) + usedVariableList(tempIndex&).varType
|
cmd$ = cmd$ + MKL$(tempIndex&) + MKL$(usedVariableList(tempIndex&).localIndex) + usedVariableList(tempIndex&).varType
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
END IF
|
END IF
|
||||||
|
@ -6953,8 +6958,11 @@ SUB DebugMode
|
||||||
LOOP
|
LOOP
|
||||||
END IF
|
END IF
|
||||||
CASE "global var", "local var"
|
CASE "global var", "local var"
|
||||||
|
_ECHO "Received " + cmd$
|
||||||
tempIndex& = CVL(LEFT$(value$, 4))
|
tempIndex& = CVL(LEFT$(value$, 4))
|
||||||
value$ = MID$(value$, 5)
|
value$ = MID$(value$, 5)
|
||||||
|
_ECHO "index = " + STR$(tempIndex&)
|
||||||
|
_ECHO "=== value$ = " + value$
|
||||||
usedVariableList(tempIndex&).mostRecentValue = value$
|
usedVariableList(tempIndex&).mostRecentValue = value$
|
||||||
CASE "current sub"
|
CASE "current sub"
|
||||||
currentSub$ = value$
|
currentSub$ = value$
|
||||||
|
|
|
@ -31,7 +31,7 @@ DIM SHARED vWatchNewVariable$, vWatchVariableExclusions$
|
||||||
vWatchErrorCall$ = "if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"
|
vWatchErrorCall$ = "if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"
|
||||||
vWatchVariableExclusions$ = "@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@" + _
|
vWatchVariableExclusions$ = "@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@" + _
|
||||||
"@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS" + _
|
"@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS" + _
|
||||||
"@__ARRAY_BYTE_VWATCH_SKIPLINES@"
|
"@__ARRAY_BYTE_VWATCH_SKIPLINES@__STRING_VWATCH_INTERNALSUBNAME@"
|
||||||
|
|
||||||
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
|
||||||
|
@ -5158,6 +5158,8 @@ DO
|
||||||
|
|
||||||
PRINT #12, "qbs_set(__STRING_VWATCH_SUBNAME,qbs_new_txt_len(" + CHR$(34) + inclinenump$ + subfuncoriginalname$ + CHR$(34) + "," + str2$(LEN(inclinenump$ + subfuncoriginalname$)) + "));"
|
PRINT #12, "qbs_set(__STRING_VWATCH_SUBNAME,qbs_new_txt_len(" + CHR$(34) + inclinenump$ + subfuncoriginalname$ + CHR$(34) + "," + str2$(LEN(inclinenump$ + subfuncoriginalname$)) + "));"
|
||||||
PRINT #12, "qbs_cleanup(qbs_tmp_base,0);"
|
PRINT #12, "qbs_cleanup(qbs_tmp_base,0);"
|
||||||
|
PRINT #12, "qbs_set(__STRING_VWATCH_INTERNALSUBNAME,qbs_new_txt_len(" + CHR$(34) + subfunc + CHR$(34) + "," + str2$(LEN(subfunc)) + "));"
|
||||||
|
PRINT #12, "qbs_cleanup(qbs_tmp_base,0);"
|
||||||
PRINT #12, "*__LONG_VWATCH_LINENUMBER=-2; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"
|
PRINT #12, "*__LONG_VWATCH_LINENUMBER=-2; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
Loading…
Reference in a new issue