1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-26 17:10:38 +00:00

Watches INTEGER, UINTEGER, LONG, ULONG, SINGLE, DOUBLE variables.

Only in the main module for now.
This commit is contained in:
FellippeHeitor 2021-07-26 23:56:48 -03:00
parent c0b445789f
commit 426b26b002
2 changed files with 20 additions and 11 deletions

View file

@ -7,6 +7,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
STATIC buffer$, endc$
DIM AS LONG i, tempIndex, localIndex
DIM AS _OFFSET address
DIM AS _MEM m
DIM start!, temp$, cmd$, value$, k&, dataType$, result$
DECLARE LIBRARY
@ -164,6 +165,12 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
IF vwatch_breakpoints(vwatch_linenumber) THEN cmd$ = "breakpoint:"
cmd$ = cmd$ + MKL$(vwatch_linenumber)
GOSUB SendCommand
IF vwatch_sublevel > 1 THEN
cmd$ = "current sub:" + vwatch_subname$
ELSE
cmd$ = "current sub:"
END IF
GOSUB SendCommand
DO 'main loop
SELECT CASE cmd$
@ -217,10 +224,8 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
localIndex = CVL(MID$(value$, 5, 4))
dataType$ = MID$(value$, 9)
address = globalVariables + LEN(address) * localIndex
address = _MEMGET(m, address, _OFFSET)
GOSUB GetMemData
$CONSOLE
_ECHO "global var requested:" + STR$(tempIndex) + STR$(localIndex) + " " + dataType$
_ECHO "== result = " + result$
cmd$ = "global var:" + MKL$(tempIndex) + result$
GOSUB SendCommand
CASE "local var"
@ -228,13 +233,11 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
localIndex = CVL(MID$(value$, 5, 4))
dataType$ = MID$(value$, 9)
address = localVariables + LEN(address) * localIndex
GOSUB GetMemData
_ECHO "local var requested:" + STR$(tempIndex) + STR$(localIndex) + " " + dataType$
_ECHO "== result = " + result$
address = _MEMGET(m, address, _OFFSET)
cmd$ = "local var:" + MKL$(tempIndex) + result$
GOSUB SendCommand
CASE "current sub"
cmd$ = "current sub:" + vwatch_subname
cmd$ = "current sub:" + vwatch_subname$
GOSUB SendCommand
CASE "set next line"
pauseMode = -1
@ -306,7 +309,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
DIM integerType AS INTEGER, uintegerType AS _UNSIGNED INTEGER
DIM longType AS LONG, ulongType AS _UNSIGNED LONG
DIM singleType AS SINGLE, doubleType AS DOUBLE
DIM varOffset AS _OFFSET, m AS _MEM, m2 AS _MEM
DIM varOffset AS _OFFSET, m2 AS _MEM
SELECT CASE dataType$
CASE "INTEGER"

View file

@ -6273,6 +6273,7 @@ SUB DebugMode
STATIC client&
STATIC buffer$
STATIC endc$
STATIC currentSub$
timeout = 10
_KEYCLEAR
@ -6938,13 +6939,16 @@ SUB DebugMode
tempIndex& = CVL(LEFT$(temp$, 4))
temp$ = MID$(temp$, 5)
IF usedVariableList(tempIndex&).watch THEN
cmd$ = ""
IF LEN(usedVariableList(tempIndex&).subfunc) = 0 THEN
cmd$ = "global var:"
ELSE
ELSEIF usedVariableList(tempIndex&).subfunc = currentSub$ THEN
cmd$ = "local var:"
END IF
cmd$ = cmd$ + MKL$(tempIndex&) + MKL$(usedVariableList(tempIndex&).localIndex) + usedVariableList(tempIndex&).varType
GOSUB SendCommand
IF LEN(cmd$) THEN
cmd$ = cmd$ + MKL$(tempIndex&) + MKL$(usedVariableList(tempIndex&).localIndex) + usedVariableList(tempIndex&).varType
GOSUB SendCommand
END IF
END IF
LOOP
END IF
@ -6952,6 +6956,8 @@ SUB DebugMode
tempIndex& = CVL(LEFT$(value$, 4))
value$ = MID$(value$, 5)
usedVariableList(tempIndex&).mostRecentValue = value$
CASE "current sub"
currentSub$ = value$
CASE "quit"
CLOSE #client&
dummy = DarkenFGBG(0)