mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-22 11:25:08 +00:00
Adds View->Call stack.
This commit is contained in:
parent
b389cc07e9
commit
bb032b6b75
2 changed files with 40 additions and 8 deletions
|
@ -19,7 +19,8 @@ DIM SHARED IdeSystem AS LONG
|
||||||
'3=Scrolling within the help window
|
'3=Scrolling within the help window
|
||||||
IdeSystem = 1
|
IdeSystem = 1
|
||||||
|
|
||||||
DIM SHARED IdeDebugMode AS LONG
|
DIM SHARED IdeDebugMode AS LONG, callStackLength AS LONG
|
||||||
|
DIM SHARED callstacklist$
|
||||||
|
|
||||||
DIM SHARED IdeRecentLink(1 TO 6, 1 TO 2) AS STRING
|
DIM SHARED IdeRecentLink(1 TO 6, 1 TO 2) AS STRING
|
||||||
DIM SHARED IdeOpenFile AS STRING 'makes IdeOpen directly open the file passed
|
DIM SHARED IdeOpenFile AS STRING 'makes IdeOpen directly open the file passed
|
||||||
|
@ -213,7 +214,7 @@ DIM SHARED OptionsMenuShowErrorsImmediately AS INTEGER, OptionsMenuIgnoreWarning
|
||||||
DIM SHARED OptionsMenuDisableSyntax AS INTEGER ', OptionsMenuAutoComplete
|
DIM SHARED OptionsMenuDisableSyntax AS INTEGER ', OptionsMenuAutoComplete
|
||||||
DIM SHARED ViewMenuID AS INTEGER, ViewMenuShowLineNumbersSubMenuID AS INTEGER
|
DIM SHARED ViewMenuID AS INTEGER, ViewMenuShowLineNumbersSubMenuID AS INTEGER
|
||||||
DIM SHARED ViewMenuShowSeparatorID AS INTEGER, ViewMenuShowBGID AS INTEGER
|
DIM SHARED ViewMenuShowSeparatorID AS INTEGER, ViewMenuShowBGID AS INTEGER
|
||||||
DIM SHARED ViewMenuCompilerWarnings AS INTEGER
|
DIM SHARED ViewMenuCompilerWarnings AS INTEGER, ViewMenuCallStack AS INTEGER
|
||||||
DIM SHARED RunMenuID AS INTEGER, RunMenuSaveExeWithSource AS INTEGER, brackethighlight AS INTEGER
|
DIM SHARED RunMenuID AS INTEGER, RunMenuSaveExeWithSource AS INTEGER, brackethighlight AS INTEGER
|
||||||
DIM SHARED multihighlight AS INTEGER, keywordHighlight AS INTEGER
|
DIM SHARED multihighlight AS INTEGER, keywordHighlight AS INTEGER
|
||||||
DIM SHARED PresetColorSchemes AS INTEGER, TotalColorSchemes AS INTEGER, ColorSchemes$(0)
|
DIM SHARED PresetColorSchemes AS INTEGER, TotalColorSchemes AS INTEGER, ColorSchemes$(0)
|
||||||
|
|
|
@ -271,6 +271,10 @@ FUNCTION ide2 (ignore)
|
||||||
ViewMenuCompilerWarnings = i
|
ViewMenuCompilerWarnings = i
|
||||||
menu$(ViewMenuID, ViewMenuCompilerWarnings) = "Compiler #Warnings... Ctrl+W": i = i + 1
|
menu$(ViewMenuID, ViewMenuCompilerWarnings) = "Compiler #Warnings... Ctrl+W": i = i + 1
|
||||||
menuDesc$(m, i - 1) = "Displays a list of recent code warnings"
|
menuDesc$(m, i - 1) = "Displays a list of recent code warnings"
|
||||||
|
|
||||||
|
ViewMenuCallStack = i
|
||||||
|
menu$(ViewMenuID, ViewMenuCallStack) = "Call #Stack... F4": i = i + 1
|
||||||
|
menuDesc$(m, i - 1) = "Displays the call stack of the current program's last execution"
|
||||||
menusize(m) = i - 1
|
menusize(m) = i - 1
|
||||||
|
|
||||||
m = m + 1: i = 0: SearchMenuID = m
|
m = m + 1: i = 0: SearchMenuID = m
|
||||||
|
@ -470,6 +474,7 @@ FUNCTION ide2 (ignore)
|
||||||
'new blank text field
|
'new blank text field
|
||||||
idet$ = MKL$(0) + MKL$(0): idel = 1: ideli = 1: iden = 1: IdeBmkN = 0
|
idet$ = MKL$(0) + MKL$(0): idel = 1: ideli = 1: iden = 1: IdeBmkN = 0
|
||||||
REDIM IdeBreakpoints(iden) AS _BYTE
|
REDIM IdeBreakpoints(iden) AS _BYTE
|
||||||
|
callstacklist$ = "": callStackLength = 0
|
||||||
ideunsaved = -1
|
ideunsaved = -1
|
||||||
idechangemade = 1
|
idechangemade = 1
|
||||||
|
|
||||||
|
@ -1563,9 +1568,7 @@ FUNCTION ide2 (ignore)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF KB = KEY_F8 OR startPausedPending = -1 THEN
|
IF KB = KEY_F8 OR startPausedPending = -1 THEN
|
||||||
startPausedPending = 0
|
GOTO startPausedMenuHandler
|
||||||
startPaused = -1
|
|
||||||
GOTO idemrun
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF KB = KEY_F9 THEN 'toggle breakpoint
|
IF KB = KEY_F9 THEN 'toggle breakpoint
|
||||||
|
@ -1578,6 +1581,10 @@ FUNCTION ide2 (ignore)
|
||||||
GOTO idemrunspecial
|
GOTO idemrunspecial
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
IF KB = KEY_F4 THEN
|
||||||
|
GOTO showCallStackDialog
|
||||||
|
END IF
|
||||||
|
|
||||||
IF KB = KEY_F5 THEN 'Note: F5 or SHIFT+F5 accepted
|
IF KB = KEY_F5 THEN 'Note: F5 or SHIFT+F5 accepted
|
||||||
startPaused = 0
|
startPaused = 0
|
||||||
idemrun:
|
idemrun:
|
||||||
|
@ -4288,6 +4295,12 @@ FUNCTION ide2 (ignore)
|
||||||
menu$(ViewMenuID, ViewMenuCompilerWarnings) = "Compiler #Warnings... Ctrl+W"
|
menu$(ViewMenuID, ViewMenuCompilerWarnings) = "Compiler #Warnings... Ctrl+W"
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
IF callStackLength = 0 THEN
|
||||||
|
menu$(ViewMenuID, ViewMenuCallStack) = "~Call #Stack... F4"
|
||||||
|
ELSE
|
||||||
|
menu$(ViewMenuID, ViewMenuCallStack) = "Call #Stack... F4"
|
||||||
|
END IF
|
||||||
|
|
||||||
oldmy = mY: oldmx = mX
|
oldmy = mY: oldmx = mX
|
||||||
DO
|
DO
|
||||||
PCOPY 2, 1
|
PCOPY 2, 1
|
||||||
|
@ -5295,6 +5308,15 @@ FUNCTION ide2 (ignore)
|
||||||
GOTO ideloop
|
GOTO ideloop
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
IF menu$(m, s) = "Call #Stack... F4" THEN
|
||||||
|
PCOPY 2, 0
|
||||||
|
showCallStackDialog:
|
||||||
|
retval = idecallstackbox
|
||||||
|
'retval is ignored
|
||||||
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
|
GOTO ideloop
|
||||||
|
END IF
|
||||||
|
|
||||||
IF menu$(m, s) = "#Find... Ctrl+F3" THEN
|
IF menu$(m, s) = "#Find... Ctrl+F3" THEN
|
||||||
PCOPY 2, 0
|
PCOPY 2, 0
|
||||||
idefindjmp:
|
idefindjmp:
|
||||||
|
@ -5583,6 +5605,7 @@ FUNCTION ide2 (ignore)
|
||||||
|
|
||||||
IF menu$(m, s) = "Start #Paused F8" THEN
|
IF menu$(m, s) = "Start #Paused F8" THEN
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
|
startPausedMenuHandler:
|
||||||
IF vWatchOn = 0 THEN
|
IF vWatchOn = 0 THEN
|
||||||
result = idemessagebox("Toggle Breakpoint", "Insert $DEBUG metacommand?", "#Yes;#No")
|
result = idemessagebox("Toggle Breakpoint", "Insert $DEBUG metacommand?", "#Yes;#No")
|
||||||
IF result = 1 THEN
|
IF result = 1 THEN
|
||||||
|
@ -5679,6 +5702,7 @@ FUNCTION ide2 (ignore)
|
||||||
ideunsaved = -1
|
ideunsaved = -1
|
||||||
'new blank text field
|
'new blank text field
|
||||||
REDIM IdeBreakpoints(1) AS _BYTE
|
REDIM IdeBreakpoints(1) AS _BYTE
|
||||||
|
callstacklist$ = "": callStackLength = 0
|
||||||
idet$ = MKL$(0) + MKL$(0): idel = 1: ideli = 1: iden = 1: IdeBmkN = 0
|
idet$ = MKL$(0) + MKL$(0): idel = 1: ideli = 1: iden = 1: IdeBmkN = 0
|
||||||
idesx = 1
|
idesx = 1
|
||||||
idesy = 1
|
idesy = 1
|
||||||
|
@ -6065,7 +6089,11 @@ SUB DebugMode
|
||||||
timeout = 10
|
timeout = 10
|
||||||
_KEYCLEAR
|
_KEYCLEAR
|
||||||
|
|
||||||
IF IdeDebugMode = 1 THEN PauseMode = 0
|
IF IdeDebugMode = 1 THEN
|
||||||
|
PauseMode = 0
|
||||||
|
callStackLength = 0
|
||||||
|
callstacklist$ = ""
|
||||||
|
END IF
|
||||||
|
|
||||||
SCREEN , , 3, 0
|
SCREEN , , 3, 0
|
||||||
COLOR 0, 7: _PRINTSTRING (1, 1), SPACE$(LEN(menubar$))
|
COLOR 0, 7: _PRINTSTRING (1, 1), SPACE$(LEN(menubar$))
|
||||||
|
@ -6414,7 +6442,8 @@ SUB DebugMode
|
||||||
|
|
||||||
IF cmd$ = "call stack" THEN
|
IF cmd$ = "call stack" THEN
|
||||||
'display call stack
|
'display call stack
|
||||||
retval = idecallstackbox(value$, callStackLength)
|
callstacklist$ = value$
|
||||||
|
retval = idecallstackbox
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
clearStatusWindow 0
|
clearStatusWindow 0
|
||||||
setStatusMessage 1, "Paused.", 2
|
setStatusMessage 1, "Paused.", 2
|
||||||
|
@ -6559,7 +6588,7 @@ SUB DebugMode
|
||||||
|
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
FUNCTION idecallstackbox(callstacklist$, callStackLength)
|
FUNCTION idecallstackbox
|
||||||
|
|
||||||
'-------- generic dialog box header --------
|
'-------- generic dialog box header --------
|
||||||
PCOPY 0, 2
|
PCOPY 0, 2
|
||||||
|
@ -8636,6 +8665,8 @@ FUNCTION idefiledialog$(programname$, mode AS _BYTE)
|
||||||
lineinput3buffer = ""
|
lineinput3buffer = ""
|
||||||
iden = n: IF n = 0 THEN idet$ = MKL$(0) + MKL$(0): iden = 1 ELSE idet$ = LEFT$(idet$, i2 - 1)
|
iden = n: IF n = 0 THEN idet$ = MKL$(0) + MKL$(0): iden = 1 ELSE idet$ = LEFT$(idet$, i2 - 1)
|
||||||
REDIM IdeBreakpoints(iden) AS _BYTE
|
REDIM IdeBreakpoints(iden) AS _BYTE
|
||||||
|
callstacklist$ = "": callStackLength = 0
|
||||||
|
|
||||||
ideerror = 1
|
ideerror = 1
|
||||||
ideprogname = f$: _TITLE ideprogname + " - " + WindowTitle
|
ideprogname = f$: _TITLE ideprogname + " - " + WindowTitle
|
||||||
listOfCustomKeywords$ = LEFT$(listOfCustomKeywords$, customKeywordsLength)
|
listOfCustomKeywords$ = LEFT$(listOfCustomKeywords$, customKeywordsLength)
|
||||||
|
|
Loading…
Reference in a new issue