Page 1 of 1

Runtime errors close debug output window

Posted: Tue Oct 12, 2021 4:54 am
by Axeman
Not sure if this is an actual bug, but it's certainly undesirable behavior.

I'm currently trying to track down an array index out-of-bounds issue. For some reason the Debug output window gets closed when the error is flagged. If I put a delay in I can see the window open and then close again when the runtime error causes the program to shutdown. That makes no sense as the output window normally persists after the program ends, and you need it to persist in this case so that you can see the debug information.

This is with PureBasic 5.73 LTS (Windows - x64) with debug mode enabled.

Code: Select all

; Run this with debugger enabled.
Dim TestArray( 3 )
OpenWindow( 0, 0, 0, 200, 200, "Test", #PB_Window_TitleBar | #PB_Window_SystemMenu )
Debug "Output message."
Delay( 1000 )
a = TestArray( 5 )
// Moved from "Bugs - Windows" (Kiffi)

Re: Runtime errors close debug output window

Posted: Tue Oct 12, 2021 5:21 am
by Rinzwind
It is also annoying that when you kill your program through IDE (which is indeed the only option you have in your case too) it closes the debug window... It should just stay open whatever.

Re: Runtime errors close debug output window

Posted: Tue Oct 12, 2021 12:04 pm
by BarryG
@Axeman, your code doesn't close the Debug Output window for me with 5.73 LTS (x86 or 64bit). Have you got the preference "Debugger -> Kill program after an error" turned on by mistake?

@Rinzwind: Freak said closing the Debug Output with "Kill" is by design -> viewtopic.php?p=537405#p537405

Re: Runtime errors close debug output window

Posted: Wed Oct 13, 2021 2:27 am
by Axeman
BarryG wrote: Tue Oct 12, 2021 12:04 pm @Axeman, your code doesn't close the Debug Output window for me with 5.73 LTS (x86 or 64bit). Have you got the preference "Debugger -> Kill program after an error" turned on by mistake?

@Rinzwind: Freak said closing the Debug Output with "Kill" is by design -> viewtopic.php?p=537405#p537405
Yes I forgot that I had that setting enabled, so thanks for the info. I don't think I originally enabled it by mistake though, as not killing the program causes it to go into a messy "Application not responding" busy state.

Ideally there should be a preference setting that lets you automatically shutdown the program on error so that you can edit it while still keeping the debug window open to give access to any available debug info. Outputting debug info is an explicit act and it should be assumed that the developer wants the debug window to persist as a result.