Keep debug window open after program ends
Keep debug window open after program ends
Is there a way to keep the debug window open after a program ends? or at east, not loose what's in there (so you can use debugger->debugger output to view it?
Re: Keep debug window open after program ends
Hi Jassing,
May be you could try to use the standalone debugger.
Thanks
Allen
May be you could try to use the standalone debugger.
Thanks
Allen
Re: Keep debug window open after program ends
There are two options in the IDE preferences under Menu → Preferences → Debugger. The second will preserve the current content of the debugger windows until you manually end the program:
"Stop execution at program start"
"Stop execution before program end"
Or you can put "CallDebugger" at the end of the code.
Or there is SaveDebugOutput which will write the content of the window to a file.
"Stop execution at program start"
"Stop execution before program end"
Or you can put "CallDebugger" at the end of the code.
Or there is SaveDebugOutput which will write the content of the window to a file.
Re: Keep debug window open after program ends
Preferences -> Debugger -> Enable: Keep all debugger windows on top
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- Michael Vogel
- Addict
- Posts: 2797
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Keep debug window open after program ends
Maybe the following macro could be useful, but then you need to modify all debug lines
Code: Select all
Macro Log(log)
If OpenFile(666,#PB_Compiler_FilePath+"Debug.log",#PB_File_Append)
Debug RSet(Str(#PB_Compiler_Line),4)+" | "+log
WriteStringN(666,FormatDate("%DD.%MM.%YYYY %HH:%II:%SS #",Date())+RSet(Str(#PB_Compiler_Line),5,"0")+":"+LSet(#PB_Compiler_Procedure,10)+"| "+log)
CloseFile(666)
EndIf
EndMacro
Procedure Test(a,e)
For i=a To e
Log(Str(i))
Next i
EndProcedure
Log("Start")
test(1,5)
Log("Stop")
Re: Keep debug window open after program ends
In my case, the debug window remains open after exiting with my setting.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Keep debug window open after program ends
Michael Vogel wrote: Wed May 01, 2024 1:06 pm Maybe the following macro could be useful, but then you need to modify all debug linesCode: Select all
Macro Log(log) ...
Please bear in mind that Log() is a Math-Lib command and overlaying existing commands can lead to problems later on. (smartass alert)

BTW: Sometimes I use OutputDebugString_() while "debugging" release versions.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Re: Keep debug window open after program ends
mk-soft wrote: Wed May 01, 2024 3:12 pm In my case, the debug window remains open after exiting with my setting.
If the program crashes, or you stop it - the debug window closes.
Here's an example.
When it crashes, you cannot review the debug output, and it closes.
Code: Select all
For x = 1 To 300
Debug Random(20000,1)/Random(10,1)
Next
RaiseError(#ERROR_INVALID_ADDRESS)
Re: Keep debug window open after program ends
The Debug Output window stays open here with your example, Jassing. It only closes if I click the "Kill Program" button (red X).
Re: Keep debug window open after program ends
BarryG wrote: Fri May 03, 2024 1:17 am The Debug Output window stays open here with your example, Jassing. It only closes if I click the "Kill Program" button (red X).
OK -- Still, would be useful to still have this output available.
Re: Keep debug window open after program ends
You can send the debug output to the IDE so that it's always available and not lose it. You can copy the output from there, too.

Re: Keep debug window open after program ends
sure, but that's not the same as just leaving the debug window open...BarryG wrote: Sat May 11, 2024 1:53 am You can send the debug output to the IDE so that it's always available and not lose it. You can copy the output from there, too.