mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-28 11:17:46 +00:00
Watches INTEGER, UINTEGER, LONG, ULONG, SINGLE, DOUBLE variables.
Only in the main module for now.
This commit is contained in:
parent
c0b445789f
commit
426b26b002
2 changed files with 20 additions and 11 deletions
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue