From f680e6bda0e7316648b74772c261eef5801d4351 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 20 Sep 2021 22:52:19 -0300 Subject: [PATCH 1/6] Minor fix in `vwatch.bm` (signed vs unsigned) --- internal/support/vwatch/vwatch.bm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/support/vwatch/vwatch.bm b/internal/support/vwatch/vwatch.bm index 59fef9201..3bfb642fc 100644 --- a/internal/support/vwatch/vwatch.bm +++ b/internal/support/vwatch/vwatch.bm @@ -373,7 +373,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET) IF INSTR(vw_varType$, "UNSIGNED") THEN vw_buf$ = _MK$(_UNSIGNED _INTEGER64, call_getubits~&&(vw_i, vw_address, vw_realArrayIndex)) ELSE - vw_buf$ = _MK$(_UNSIGNED _INTEGER64, call_getbits&&(vw_i, vw_address, vw_realArrayIndex)) + vw_buf$ = _MK$(_INTEGER64, call_getbits&&(vw_i, vw_address, vw_realArrayIndex)) END IF IF vw_checkingWatchpoints THEN RETURN From bb7716812711d91112603f57f10bc225b858281a Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 20 Sep 2021 23:33:38 -0300 Subject: [PATCH 2/6] Properly recovers after an error in DebugMode. --- source/ide/ide_methods.bas | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index d03b2ceab..7a8ed004f 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -145,7 +145,6 @@ FUNCTION ide2 (ignore) 'report any IDE errors which have occurred IF ideerror THEN IF IdeDebugMode THEN - IdeDebugMode = 0 COLOR 0, 7: _PRINTSTRING (1, 1), menubar$ END IF mustdisplay = 1 @@ -187,11 +186,15 @@ FUNCTION ide2 (ignore) 'a more serious error; let's report something that'll help bug reporting inclerrorline = _INCLERRORLINE IF inclerrorline THEN - errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(module: " + _ - RemoveFileExtension$(LEFT$(_INCLERRORFILE$, 60)) - errorat$ = errorat$ + ", on line: " + str2$(inclerrorline) + ", " + MID$(AutoBuildMsg$, 10) + ")" + errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(module: " + _ + RemoveFileExtension$(LEFT$(_INCLERRORFILE$, 60)) + errorat$ = errorat$ + ", on line: " + str2$(inclerrorline) + IF LEN(AutoBuildMsg$) THEN errorat$ = errorat$ + ", " + MID$(AutoBuildMsg$, 10) + errorat$ = errorat$ + ")" ELSE - errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(on line: " + str2$(_ERRORLINE) + ", " + MID$(AutoBuildMsg$, 10) + ")" + errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(on line: " + str2$(_ERRORLINE) + IF LEN(AutoBuildMsg$) THEN errorat$ = errorat$ + ", " + MID$(AutoBuildMsg$, 10) + errorat$ = errorat$ + ")" END IF END IF @@ -746,6 +749,12 @@ FUNCTION ide2 (ignore) changingTcpPort = 0 END IF + IF IdeDebugMode THEN + idecompiling = 0 + ready = 1 + GOSUB redrawItAll + GOTO ExitDebugMode 'IdeDebugMode must be 0 here, if not, DebugMode errored. + END IF IF c$ = CHR$(254) THEN '$DEBUG mode on IdeDebugMode = 1 @@ -767,6 +776,7 @@ FUNCTION ide2 (ignore) ready = 1 _RESIZE OFF DebugMode + ExitDebugMode: IF WatchListToConsole THEN _CONSOLE OFF UpdateMenuHelpLine "" SELECT CASE IdeDebugMode From dd302b0b5f65de485aaab9bfdaeeff04fccf4d51 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 21 Sep 2021 01:28:50 -0300 Subject: [PATCH 3/6] Sends focus to debuggee when function `INPUT$()` is called. --- source/qb64.bas | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/qb64.bas b/source/qb64.bas index 6f9236aeb..0fa77c539 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -792,6 +792,7 @@ DIM SHARED linefragment AS STRING DIM SHARED arrayprocessinghappened AS INTEGER DIM SHARED stringprocessinghappened AS INTEGER DIM SHARED cleanupstringprocessingcall AS STRING +DIM SHARED inputfunctioncalled AS _BYTE DIM SHARED recompile AS INTEGER 'forces recompilation 'COMMON SHARED cmemlist() AS INTEGER DIM SHARED optionbase AS INTEGER @@ -1451,6 +1452,7 @@ linefragment$ = "" idn = 0 arrayprocessinghappened = 0 stringprocessinghappened = 0 +inputfunctioncalled = 0 subfuncn = 0 closedsubfunc = 0 subfunc = "" @@ -11206,6 +11208,13 @@ DO THENGOTO = 0 finishedline2: + IF inputfunctioncalled THEN + inputfunctioncalled = 0 + IF vWatchOn = 1 THEN + PRINT #12, "*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);" + END IF + END IF + IF arrayprocessinghappened = 1 THEN arrayprocessinghappened = 0 inclinenump$ = "" @@ -16582,6 +16591,12 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG) targetid = currentid IF RTRIM$(id2.callname) = "func_stub" THEN Give_Error "Command not implemented": EXIT FUNCTION + IF RTRIM$(id2.callname) = "func_input" AND inputfunctioncalled = 0 THEN + inputfunctioncalled = -1 + IF vWatchOn = 1 THEN + PRINT #12, "*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);" + END IF + END IF SetDependency id2.Dependency From a6672058ff7b795ee00bb317081e719d0476d1c5 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 21 Sep 2021 02:14:06 -0300 Subject: [PATCH 4/6] Properly deals with _BIT variables when $NoPrefix is active. --- source/ide/ide_methods.bas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 7a8ed004f..faa23f69f 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -8301,7 +8301,7 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar, returnAction) varType$ = usedVariableList(tempIndex&).varType tempVarType$ = varType$ IF INSTR(varType$, "STRING *") THEN tempVarType$ = "STRING" - IF INSTR(varType$, "_BIT *") THEN tempVarType$ = "_BIT" + IF INSTR(varType$, "BIT *") THEN tempVarType$ = "_BIT" IF INSTR(nativeDataTypes$, tempVarType$) = 0 THEN 'It's a UDT tempIsUDT& = -1 @@ -8768,7 +8768,7 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar, returnAction) varType$ = usedVariableList(varDlgList(y).index).varType IF INSTR(varType$, "STRING *") THEN varType$ = "STRING" - IF INSTR(varType$, "_BIT *") THEN varType$ = "_BIT" + IF INSTR(varType$, "BIT *") THEN varType$ = "_BIT" IF INSTR(nativeDataTypes$, varType$) = 0 THEN 'It's a UDT elementIndexes$ = "" From 5f9a58a620be445dd49462149f2ea4cd236e0e66 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 21 Sep 2021 02:22:46 -0300 Subject: [PATCH 5/6] Fixes "Add All" in Watch List (_Bit variables + $NoPrefix). --- source/ide/ide_methods.bas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index faa23f69f..c1c17fc8e 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -8210,7 +8210,7 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar, returnAction) FOR y = 1 TO totalVisibleVariables varType$ = usedVariableList(y).varType IF INSTR(varType$, "STRING *") THEN varType$ = "STRING" - IF INSTR(varType$, "_BIT *") THEN varType$ = "_BIT" + IF INSTR(varType$, "BIT *") THEN varType$ = "_BIT" IF (usedVariableList(varDlgList(y).index).isarray AND LEN(usedVariableList(varDlgList(y).index).watchRange) = 0) OR _ INSTR(nativeDataTypes$, varType$) = 0 THEN _CONTINUE usedVariableList(varDlgList(y).index).watch = -1 From 5cab1880b5537ea42aadfa5c3a08808cbd0c2b3d Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 21 Sep 2021 02:54:41 -0300 Subject: [PATCH 6/6] Uses GetLogicalDrives() in Windows (file dialogs). Closes #183 --- internal/c/qbx.cpp | 8 ++++++++ source/ide/ide_methods.bas | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/c/qbx.cpp b/internal/c/qbx.cpp index 742c07e50..f92589362 100755 --- a/internal/c/qbx.cpp +++ b/internal/c/qbx.cpp @@ -961,6 +961,14 @@ void call_setbits(uint32 bsize,ptrszint *array,ptrszint i,int64 val) { setbits(bsize,(uint8*)(*array),i,val); } +int32 logical_drives() { + #ifdef QB64_WINDOWS + return GetLogicalDrives(); + #else + return 0; + #endif +} + inline ptrszint array_check(uptrszint index,uptrszint limit){ //nb. forces signed index into an unsigned variable for quicker comparison if (index sep AND LEN(pathlist$) > 0 THEN pathlist$ = pathlist$ + sep - IF _DIREXISTS(CHR$(65 + i) + ":\") THEN + IF _READBIT(d, i) THEN pathlist$ = pathlist$ + CHR$(65 + i) + ":" END IF NEXT + idezpathlist$ = pathlist$ EXIT FUNCTION END IF