1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 09:20:38 +00:00

Allows outputting the watch list to the console.

This commit is contained in:
FellippeHeitor 2021-08-22 11:49:48 -03:00
parent 9423080f6b
commit bf9ab3458c
4 changed files with 85 additions and 68 deletions

View file

@ -261,7 +261,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
vw_arrayIndex = CVL(MID$(vw_value$, 10, 4)) vw_arrayIndex = CVL(MID$(vw_value$, 10, 4))
vw_elementoffset = _CV(_OFFSET, MID$(vw_value$, 14, LEN(vw_elementoffset))) vw_elementoffset = _CV(_OFFSET, MID$(vw_value$, 14, LEN(vw_elementoffset)))
vw_varSize = CVL(MID$(vw_value$, 14 + LEN(vw_elementoffset), 4)) vw_varSize = CVL(MID$(vw_value$, 14 + LEN(vw_elementoffset), 4))
IF vw_varSize = 0 THEN PRINT "NoSize": GOTO cmdProcessingDone IF vw_varSize = 0 THEN GOTO cmdProcessingDone
vw_i = CVI(MID$(vw_value$, 18 + LEN(vw_elementoffset), 2)) vw_i = CVI(MID$(vw_value$, 18 + LEN(vw_elementoffset), 2))
IF vw_i THEN IF vw_i THEN
vw_scope$ = MID$(vw_value$, 20 + LEN(vw_elementoffset), vw_i) vw_scope$ = MID$(vw_value$, 20 + LEN(vw_elementoffset), vw_i)
@ -316,7 +316,6 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
END IF END IF
'vw_address now points to the actual data 'vw_address now points to the actual data
PRINT "vw_elementoffset =" ; vw_elementoffset
vw_address = vw_address + vw_elementoffset vw_address = vw_address + vw_elementoffset
vw_buf$ = SPACE$(vw_varSize) vw_buf$ = SPACE$(vw_varSize)
vw_m = _MEM(vw_address, vw_varSize) vw_m = _MEM(vw_address, vw_varSize)

View file

@ -14,10 +14,10 @@ DIM SHARED ShowLineNumbersSeparator AS _BYTE, ShowLineNumbersUseBG AS _BYTE
DIM SHARED IgnoreWarnings AS _BYTE, qb64versionprinted AS _BYTE DIM SHARED IgnoreWarnings AS _BYTE, qb64versionprinted AS _BYTE
DIM SHARED DisableSyntaxHighlighter AS _BYTE, ExeToSourceFolderFirstTimeMsg AS _BYTE DIM SHARED DisableSyntaxHighlighter AS _BYTE, ExeToSourceFolderFirstTimeMsg AS _BYTE
DIM SHARED WhiteListQB64FirstTimeMsg AS _BYTE, ideautolayoutkwcapitals AS _BYTE DIM SHARED WhiteListQB64FirstTimeMsg AS _BYTE, ideautolayoutkwcapitals AS _BYTE
'DIM SHARED IdeAutoComplete AS _BYTE DIM SHARED WatchListToConsole AS _BYTE
DIM SHARED windowSettingsSection$, colorSettingsSection$, customDictionarySection$ DIM SHARED windowSettingsSection$, colorSettingsSection$, customDictionarySection$
DIM SHARED mouseSettingsSection$, generalSettingsSection$, displaySettingsSection$ DIM SHARED mouseSettingsSection$, generalSettingsSection$, displaySettingsSection$
DIM SHARED colorSchemesSection$, iniFolderIndex$, DebugInfoIniWarning$, ConfigFile$ DIM SHARED colorSchemesSection$, debugSettingsSection$, iniFolderIndex$, DebugInfoIniWarning$, ConfigFile$
DIM SHARED idebaseTcpPort AS LONG DIM SHARED idebaseTcpPort AS LONG
windowSettingsSection$ = "IDE WINDOW" windowSettingsSection$ = "IDE WINDOW"
@ -27,6 +27,7 @@ customDictionarySection$ = "CUSTOM DICTIONARIES"
mouseSettingsSection$ = "MOUSE SETTINGS" mouseSettingsSection$ = "MOUSE SETTINGS"
generalSettingsSection$ = "GENERAL SETTINGS" generalSettingsSection$ = "GENERAL SETTINGS"
displaySettingsSection$ = "IDE DISPLAY SETTINGS" displaySettingsSection$ = "IDE DISPLAY SETTINGS"
debugSettingsSection$ = "DEBUG SETTINGS"
ConfigFile$ = "internal/config.ini" ConfigFile$ = "internal/config.ini"
iniFolderIndex$ = STR$(tempfolderindex) iniFolderIndex$ = STR$(tempfolderindex)
@ -203,26 +204,10 @@ ELSE
WriteConfigSetting generalSettingsSection$, "IgnoreWarnings", "False" WriteConfigSetting generalSettingsSection$, "IgnoreWarnings", "False"
END IF END IF
'IF ReadConfigSetting(generalSettingsSection$, "IdeAutoComplete", value$) THEN
' IF UCASE$(value$) = "TRUE" OR ABS(VAL(value$)) = 1 THEN
' IdeAutoComplete = -1
' ELSE
' IdeAutoComplete = 0
' WriteConfigSetting generalSettingsSection$, "IdeAutoComplete", "False"
' END IF
'ELSE
' IdeAutoComplete = -1
' WriteConfigSetting generalSettingsSection$, "IdeAutoComplete", "True"
'END IF
result = ReadConfigSetting(generalSettingsSection$, "BackupSize", value$) result = ReadConfigSetting(generalSettingsSection$, "BackupSize", value$)
idebackupsize = VAL(value$) idebackupsize = VAL(value$)
IF idebackupsize < 10 OR idebackupsize > 2000 THEN idebackupsize = 100: WriteConfigSetting generalSettingsSection$, "BackupSize", "100 'in MB" IF idebackupsize < 10 OR idebackupsize > 2000 THEN idebackupsize = 100: WriteConfigSetting generalSettingsSection$, "BackupSize", "100 'in MB"
result = ReadConfigSetting(generalSettingsSection$, "BaseTCPPort", value$)
idebaseTcpPort = VAL(value$)
IF idebaseTcpPort = 0 THEN idebaseTcpPort = 9000: WriteConfigSetting generalSettingsSection$, "BaseTCPPort", "9000"
result = ReadConfigSetting(generalSettingsSection$, "DebugInfo", value$) result = ReadConfigSetting(generalSettingsSection$, "DebugInfo", value$)
idedebuginfo = VAL(value$) idedebuginfo = VAL(value$)
IF UCASE$(LEFT$(value$, 4)) = "TRUE" THEN idedebuginfo = 1 IF UCASE$(LEFT$(value$, 4)) = "TRUE" THEN idedebuginfo = 1
@ -242,6 +227,20 @@ ELSE
WriteConfigSetting mouseSettingsSection$, "SwapMouseButton", "False" WriteConfigSetting mouseSettingsSection$, "SwapMouseButton", "False"
END IF END IF
'Debug settings ---------------------------------------------------------------
result = ReadConfigSetting(debugSettingsSection$, "BaseTCPPort", value$)
idebaseTcpPort = VAL(value$)
IF idebaseTcpPort = 0 THEN idebaseTcpPort = 9000: WriteConfigSetting debugSettingsSection$, "BaseTCPPort", "9000"
result = ReadConfigSetting(debugSettingsSection$, "WatchListToConsole", value$)
IF UCASE$(value$) = "TRUE" OR VAL(value$) = -1 THEN
WatchListToConsole = -1
WriteConfigSetting debugSettingsSection$, "WatchListToConsole", "True"
ELSE
WatchListToConsole = 0
WriteConfigSetting debugSettingsSection$, "WatchListToConsole", "False"
END IF
'Display settings ------------------------------------------------------------- 'Display settings -------------------------------------------------------------
IF ReadConfigSetting(displaySettingsSection$, "IDE_SortSUBs", value$) THEN IF ReadConfigSetting(displaySettingsSection$, "IDE_SortSUBs", value$) THEN
IF UCASE$(value$) = "TRUE" OR VAL(value$) = -1 THEN IF UCASE$(value$) = "TRUE" OR VAL(value$) = -1 THEN

View file

@ -221,7 +221,7 @@ 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
DIM SHARED RunMenuID AS INTEGER, RunMenuSaveExeWithSource AS INTEGER, brackethighlight AS INTEGER DIM SHARED RunMenuID AS INTEGER, RunMenuSaveExeWithSource AS INTEGER, brackethighlight AS INTEGER
DIM SHARED DebugMenuID AS INTEGER, DebugMenuCallStack AS INTEGER DIM SHARED DebugMenuID AS INTEGER, DebugMenuCallStack AS INTEGER, DebugMenuWatchListToConsole 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)
DIM SHARED LastValidColorScheme AS INTEGER DIM SHARED LastValidColorScheme AS INTEGER

View file

@ -357,6 +357,12 @@ FUNCTION ide2 (ignore)
menu$(DebugMenuID, DebugMenuCallStack) = "Call #Stack... F12": i = i + 1 menu$(DebugMenuID, DebugMenuCallStack) = "Call #Stack... F12": i = i + 1
menuDesc$(m, i - 1) = "Displays the call stack of the current program's last execution" menuDesc$(m, i - 1) = "Displays the call stack of the current program's last execution"
menu$(m, i) = "-": i = i + 1 menu$(m, i) = "-": i = i + 1
DebugMenuWatchListToConsole = i
menu$(m, i) = "#Output Watch List to Console": i = i + 1
menuDesc$(m, i - 1) = "Toggles directing the output of the watch list to the console window"
IF WatchListToConsole THEN
menu$(DebugMenuID, DebugMenuWatchListToConsole) = CHR$(7) + menu$(DebugMenuID, DebugMenuWatchListToConsole)
END IF
menu$(m, i) = "Set Base #TCP/IP Port Number...": i = i + 1 menu$(m, i) = "Set Base #TCP/IP Port Number...": i = i + 1
menuDesc$(m, i - 1) = "Sets the initial port number for TCP/IP communication with the debuggee" menuDesc$(m, i - 1) = "Sets the initial port number for TCP/IP communication with the debuggee"
menu$(m, i) = "#Advanced (C++)...": i = i + 1 menu$(m, i) = "#Advanced (C++)...": i = i + 1
@ -755,6 +761,7 @@ FUNCTION ide2 (ignore)
ready = 1 ready = 1
_RESIZE OFF _RESIZE OFF
DebugMode DebugMode
IF WatchListToConsole THEN _CONSOLE OFF
UpdateMenuHelpLine "" UpdateMenuHelpLine ""
SELECT CASE IdeDebugMode SELECT CASE IdeDebugMode
CASE 1 'clean exit CASE 1 'clean exit
@ -4954,22 +4961,6 @@ FUNCTION ide2 (ignore)
GOTO ideloop GOTO ideloop
END IF END IF
'IF RIGHT$(menu$(m, s), 17) = "Code Suggest#ions" THEN
' PCOPY 2, 0
' IF IdeAutoComplete = 0 THEN
' IdeAutoComplete = -1
' WriteConfigSetting generalSettingsSection$, "IdeAutoComplete", "True"
' menu$(OptionsMenuID, OptionsMenuAutoComplete) = CHR$(7) + "Code Suggest#ions"
' ELSE
' IdeAutoComplete = 0
' WriteConfigSetting generalSettingsSection$, "IdeAutoComplete", "False"
' menu$(OptionsMenuID, OptionsMenuAutoComplete) = "Code Suggest#ions"
' END IF
' idechangemade = 1
' PCOPY 3, 0: SCREEN , , 3, 0
' GOTO ideloop
'END IF
IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN
PCOPY 2, 0 PCOPY 2, 0
SaveExeWithSource = NOT SaveExeWithSource SaveExeWithSource = NOT SaveExeWithSource
@ -4985,6 +4976,21 @@ FUNCTION ide2 (ignore)
GOTO ideloop GOTO ideloop
END IF END IF
IF RIGHT$(menu$(m, s), 29) = "#Output Watch List to Console" THEN
PCOPY 2, 0
WatchListToConsole = NOT WatchListToConsole
IF WatchListToConsole THEN
WriteConfigSetting debugSettingsSection$, "WatchListToConsole", "True"
menu$(DebugMenuID, DebugMenuWatchListToConsole) = CHR$(7) + "#Output Watch List to Console"
ELSE
WriteConfigSetting debugSettingsSection$, "WatchListToConsole", "False"
menu$(DebugMenuID, DebugMenuWatchListToConsole) = "#Output Watch List to Console"
END IF
PCOPY 3, 0: SCREEN , , 3, 0
GOTO ideloop
END IF
IF MID$(menu$(m, s), 1, 17) = "#Quick Navigation" OR MID$(menu$(m, s), 2, 17) = "#Quick Navigation" THEN IF MID$(menu$(m, s), 1, 17) = "#Quick Navigation" OR MID$(menu$(m, s), 2, 17) = "#Quick Navigation" THEN
PCOPY 2, 0 PCOPY 2, 0
EnableQuickNav = NOT EnableQuickNav EnableQuickNav = NOT EnableQuickNav
@ -7553,7 +7559,10 @@ SUB DebugMode
ideshowtext ideshowtext
UpdateTitleOfMainWindow UpdateTitleOfMainWindow
IF PauseMode <> 0 AND LEN(variableWatchList$) > 0 THEN showvWatchPanel vWatchPanel, currentSub$, totalVisibleVariables IF PauseMode <> 0 AND LEN(variableWatchList$) > 0 THEN
IF WatchListToConsole THEN _CONSOLE ON
showvWatchPanel vWatchPanel, currentSub$, totalVisibleVariables
END IF
PCOPY 3, 0 PCOPY 3, 0
RETURN RETURN
@ -7622,17 +7631,21 @@ SUB showvWatchPanel (this AS vWatchPanelType, currentScope$, totalVisibleVariabl
IF this.x + this.w + 2 > idewx THEN this.x = idewx - (this.w + 2) IF this.x + this.w + 2 > idewx THEN this.x = idewx - (this.w + 2)
END IF END IF
COLOR fg, bg IF WatchListToConsole = 0 THEN
ideboxshadow this.x, this.y, this.w, this.h COLOR fg, bg
COLOR 15, bg ideboxshadow this.x, this.y, this.w, this.h
_PRINTSTRING (this.x + this.w - 1, this.y + this.h - 1), CHR$(254) 'resize handle COLOR 15, bg
_PRINTSTRING (this.x + this.w - 1, this.y + this.h - 1), CHR$(254) 'resize handle
x = LEN(title$) + 2 x = LEN(title$) + 2
COLOR fg, bg COLOR fg, bg
_PRINTSTRING (this.x + (this.w \ 2) - (x - 1) \ 2, this.y), " " + title$ + " " _PRINTSTRING (this.x + (this.w \ 2) - (x - 1) \ 2, this.y), " " + title$ + " "
COLOR 15, 4 COLOR 15, 4
_PRINTSTRING (this.x + this.w - 3, this.y), " x " 'close button _PRINTSTRING (this.x + this.w - 3, this.y), " x " 'close button
COLOR , bg COLOR , bg
ELSE
_ECHO "-------- " + title$
END IF
y = 0 y = 0
i = 0 i = 0
@ -7644,9 +7657,9 @@ SUB showvWatchPanel (this AS vWatchPanelType, currentScope$, totalVisibleVariabl
tempArrayIndex& = CVL(MID$(temp$, 5, 4)) tempArrayIndex& = CVL(MID$(temp$, 5, 4))
temp$ = MID$(temp$, 9) temp$ = MID$(temp$, 9)
i = i + 1 i = i + 1
IF this.firstVisible > i THEN _CONTINUE IF this.firstVisible > i AND WatchListToConsole <> 0 THEN _CONTINUE
y = y + 1 y = y + 1
IF y > this.h - 2 THEN EXIT DO IF y > this.h - 2 AND WatchListToConsole <> 0 THEN EXIT DO
thisName$ = usedVariableList(tempIndex&).name thisName$ = usedVariableList(tempIndex&).name
IF usedVariableList(tempIndex&).isarray THEN IF usedVariableList(tempIndex&).isarray THEN
@ -7675,30 +7688,36 @@ SUB showvWatchPanel (this AS vWatchPanelType, currentScope$, totalVisibleVariabl
COLOR fg COLOR fg
ELSE ELSE
item$ = item$ + "<out of scope>" item$ = item$ + "<out of scope>"
COLOR 2 IF WatchListToConsole = 0 THEN COLOR 2
END IF END IF
IF LEN(item$) > this.contentWidth THEN this.contentWidth = LEN(item$) IF LEN(item$) > this.contentWidth THEN this.contentWidth = LEN(item$)
_PRINTSTRING (this.x + 2, this.y + y), MID$(item$, this.hPos, this.w - 4) IF WatchListToConsole = 0 THEN
_PRINTSTRING (this.x + 2, this.y + y), MID$(item$, this.hPos, this.w - 4)
ELSE
_ECHO item$
END IF
LOOP LOOP
IF totalVisibleVariables > this.h - 2 THEN IF WatchListToConsole = 0 THEN
y = idevbar(this.x + this.w - 1, this.y + 1, this.h - 2, this.firstVisible, totalVisibleVariables - (this.h - 2) + 1) IF totalVisibleVariables > this.h - 2 THEN
IF this.draggingVBar = 0 THEN y = idevbar(this.x + this.w - 1, this.y + 1, this.h - 2, this.firstVisible, totalVisibleVariables - (this.h - 2) + 1)
this.vBarThumb = y IF this.draggingVBar = 0 THEN
this.vBarThumb = y
END IF
ELSE
this.vBarThumb = 0
this.firstVisible = 1
END IF END IF
ELSE
this.vBarThumb = 0
this.firstVisible = 1
END IF
IF this.contentWidth > this.w - 4 THEN IF this.contentWidth > this.w - 4 THEN
x = idehbar(this.x, this.y + this.h - 1, this.w - 1, this.hPos, this.contentWidth - (this.w - 4) + 1) x = idehbar(this.x, this.y + this.h - 1, this.w - 1, this.hPos, this.contentWidth - (this.w - 4) + 1)
IF this.draggingHBar = 0 THEN IF this.draggingHBar = 0 THEN
this.hBarThumb = x this.hBarThumb = x
END IF
ELSE
this.hBarThumb = 0
this.hPos = 1
END IF END IF
ELSE
this.hBarThumb = 0
this.hPos = 1
END IF END IF
END SUB END SUB
@ -13490,7 +13509,7 @@ SUB ideSetTCPPortBox
idebaseTcpPort = VAL(v$) idebaseTcpPort = VAL(v$)
IF idebaseTcpPort = 0 THEN idebaseTcpPort = 9000 IF idebaseTcpPort = 0 THEN idebaseTcpPort = 9000
WriteConfigSetting generalSettingsSection$, "BaseTCPPort", str2$(idebaseTcpPort) WriteConfigSetting debugSettingsSection$, "BaseTCPPort", str2$(idebaseTcpPort)
END SUB END SUB
FUNCTION idegetlinenumberbox(title$, initialValue&) FUNCTION idegetlinenumberbox(title$, initialValue&)