mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-28 11:17:46 +00:00
Sends call stack to IDE when an error occurs.
This commit is contained in:
parent
d1249d25d5
commit
655f1e3b19
2 changed files with 16 additions and 9 deletions
|
@ -6428,6 +6428,7 @@ SUB DebugMode
|
|||
cmd$ = "call stack"
|
||||
GOSUB SendCommand
|
||||
|
||||
IF BypassRequestCallStack THEN GOTO ShowCallStack
|
||||
dummy = DarkenFGBG(0)
|
||||
clearStatusWindow 0
|
||||
setStatusMessage 1, "Requesting call stack...", 7
|
||||
|
@ -6443,6 +6444,7 @@ SUB DebugMode
|
|||
IF cmd$ = "call stack" THEN
|
||||
'display call stack
|
||||
callstacklist$ = value$
|
||||
ShowCallStack:
|
||||
retval = idecallstackbox
|
||||
PCOPY 3, 0: SCREEN , , 3, 0
|
||||
clearStatusWindow 0
|
||||
|
@ -6510,6 +6512,7 @@ SUB DebugMode
|
|||
|
||||
SELECT CASE cmd$
|
||||
CASE "breakpoint", "line number"
|
||||
BypassRequestCallStack = 0
|
||||
l = CVL(value$)
|
||||
idecy = l
|
||||
debugnextline = l
|
||||
|
@ -6542,10 +6545,12 @@ SUB DebugMode
|
|||
clearStatusWindow 1
|
||||
COLOR , 4
|
||||
setStatusMessage 1, "Error occurred on line" + STR$(l), 13
|
||||
BypassRequestCallStack = -1
|
||||
PauseMode = -1
|
||||
CASE "call stack size"
|
||||
'call stack is only received without having been
|
||||
'requested when the program is about to quit
|
||||
'requested when the program is about to quit or
|
||||
'when an error just occurred
|
||||
callStackLength = CVL(value$)
|
||||
start! = TIMER
|
||||
DO
|
||||
|
|
|
@ -65,10 +65,7 @@ SUB vwatch (localVariables AS _OFFSET)
|
|||
END IF
|
||||
|
||||
IF vwatch_linenumber = 0 THEN
|
||||
cmd$ = "call stack size:" + MKL$(callStackLength)
|
||||
GOSUB SendCommand
|
||||
cmd$ = "call stack:" + vwatch_callstack
|
||||
GOSUB SendCommand
|
||||
GOSUB SendCallStack
|
||||
cmd$ = "quit:Program ended."
|
||||
GOSUB SendCommand
|
||||
CLOSE #ide
|
||||
|
@ -77,6 +74,7 @@ SUB vwatch (localVariables AS _OFFSET)
|
|||
EXIT SUB
|
||||
ELSEIF vwatch_linenumber = -1 THEN
|
||||
'report an error in the most recent line
|
||||
GOSUB SendCallStack
|
||||
cmd$ = "error:" + MKL$(lastLine)
|
||||
GOSUB SendCommand
|
||||
EXIT SUB
|
||||
|
@ -168,10 +166,7 @@ SUB vwatch (localVariables AS _OFFSET)
|
|||
REDIM vwatch_breakpoints(UBOUND(vwatch_breakpoints)) AS _BYTE
|
||||
CASE "call stack"
|
||||
'send call stack history"
|
||||
cmd$ = "call stack size:" + MKL$(callStackLength)
|
||||
GOSUB SendCommand
|
||||
cmd$ = "call stack:" + vwatch_callstack
|
||||
GOSUB SendCommand
|
||||
GOSUB SendCallStack
|
||||
CASE "local"
|
||||
i = CVL(value$)
|
||||
address = localVariables + LEN(address) * i
|
||||
|
@ -217,6 +212,13 @@ SUB vwatch (localVariables AS _OFFSET)
|
|||
END IF
|
||||
RETURN
|
||||
|
||||
SendCallStack:
|
||||
cmd$ = "call stack size:" + MKL$(callStackLength)
|
||||
GOSUB SendCommand
|
||||
cmd$ = "call stack:" + vwatch_callstack
|
||||
GOSUB SendCommand
|
||||
RETURN
|
||||
|
||||
SendCommand:
|
||||
cmd$ = cmd$ + endc$
|
||||
PUT #ide, , cmd$
|
||||
|
|
Loading…
Reference in a new issue