diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 77bfc3edd..3c8875774 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -6658,6 +6658,7 @@ SUB DebugMode r$ = idesubs PCOPY 3, 0: SCREEN , , 3, 0 GOSUB UpdateDisplay + WHILE _MOUSEINPUT: WEND CASE 15872 'F4 IF PauseMode THEN requestCallStack: @@ -6670,9 +6671,13 @@ SUB DebugMode setStatusMessage 1, "Requesting call stack...", 7 start! = TIMER + callStackLength = -1 DO GOSUB GetCommand - IF cmd$ = "call stack size" THEN callStackLength = CVL(value$) + IF cmd$ = "call stack size" THEN + callStackLength = CVL(value$) + IF callStackLength = 0 THEN EXIT DO + END IF _LIMIT 100 LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout @@ -6680,13 +6685,20 @@ SUB DebugMode 'display call stack callstacklist$ = value$ ShowCallStack: - retval = idecallstackbox - PCOPY 3, 0: SCREEN , , 3, 0 clearStatusWindow 0 setStatusMessage 1, "Paused.", 2 + retval = idecallstackbox + PCOPY 3, 0: SCREEN , , 3, 0 + WHILE _MOUSEINPUT: WEND ELSE - clearStatusWindow 0 - setStatusMessage 1, "Error retrieving call stack.", 2 + IF callStackLength = -1 THEN + callStackLength = 0 + clearStatusWindow 0 + setStatusMessage 1, "Error retrieving call stack.", 2 + ELSEIF callStackLength = 0 THEN + clearStatusWindow 0 + setStatusMessage 1, "No call stack log available.", 2 + END IF END IF noFocusMessage = NOT noFocusMessage END IF @@ -6759,8 +6771,9 @@ SUB DebugMode IF _KEYDOWN(100304) OR _KEYDOWN(100303) THEN result = idegetlinenumberbox("Run To Line", idecy) PCOPY 3, 0: SCREEN , , 3, 0 + WHILE _MOUSEINPUT: WEND requestRunToThisLine: - IF result > 0 AND result < iden THEN + IF result > 0 AND result <= iden THEN PauseMode = 0 debugnextline = 0 cmd$ = "run to line:" + MKL$(result) @@ -6773,8 +6786,9 @@ SUB DebugMode ELSE result = idegetlinenumberbox("Set Next Line", idecy) PCOPY 3, 0: SCREEN , , 3, 0 + WHILE _MOUSEINPUT: WEND requestSetNextLine: - IF result > 0 AND result < iden THEN + IF result > 0 AND result <= iden THEN cmd$ = "set next line:" + MKL$(result) GOSUB SendCommand END IF @@ -6784,6 +6798,7 @@ SUB DebugMode IF _KEYDOWN(100306) OR _KEYDOWN(100305) THEN result = idegetlinenumberbox("Skip Line", idecy) PCOPY 3, 0: SCREEN , , 3, 0 + WHILE _MOUSEINPUT: WEND requestToggleSkipLine: IF result > 0 AND result <= iden THEN IdeSkipLines(result) = NOT IdeSkipLines(result) @@ -6840,15 +6855,19 @@ SUB DebugMode 'requested when the program is about to quit or 'when an error just occurred callStackLength = CVL(value$) - start! = TIMER - DO - GOSUB GetCommand - _LIMIT 100 - LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout + IF callStackLength THEN + start! = TIMER + DO + GOSUB GetCommand + _LIMIT 100 + LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout - IF cmd$ = "call stack" THEN - 'store call stack - callstacklist$ = value$ + IF cmd$ = "call stack" THEN + 'store call stack + callstacklist$ = value$ + END IF + ELSE + callstacklist$ = "" END IF END SELECT