Debug - goto and line number

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Debug - goto and line number

Post by blueznl »

Currently, the Debug statement outputs a text string to the debug window, with a preceding timestamp.

Code: Select all

[14:26:21] whatever
I would like to add two options, to speed up debugging:

1. A line number, like this:

Code: Select all

[14:26:21 1223] whatever
Yeah, I can do it with a macro like this, I know, but I'd like to have it as a an option in the debugger...

Code: Select all

Macro x_debug(text)
  Debug "line "+Str(#PB_Compiler_Line)+" - "+text
EndMacro
2. A doubleclik / goto action...

When doubleclicking (or control doubleclicking) on a line in the debug output window, I'd like the editor to jump to that line. In other words, if I'd doubleclick on the line [14:26:21 1223] above, the editor should jump to line 1223.

I think these two additons could seriously speed up debugging, for example when you're spreading around 'Debug' statements to figure out what is going on, you a. know where the debug is located whose output you're looking at, and b. you can more easily get rid of 'forgotten' debugs, and c. you can leave Debug statements in for other parts of your code, without having to skip them every time you search for other Debug statements that you want to get rid of.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Debug - goto and line number

Post by Kaeru Gaman »

my debugger does not have a timestamp... o.O
oh... and have a nice day.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Debug - goto and line number

Post by c4s »

The "jump to error line" idea is pretty good. It should behave like doubleclicking on the Procedure List.

edit:
@KG
I think he's talking about the statusbar.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Debug - goto and line number

Post by #NULL »

i guess he means the error log (preferences > debugger > individual settings > display debug output in the error log)
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Debug - goto and line number

Post by freak »

The time stamp is optional. Its in the preferences.
quidquid Latine dictum sit altum videtur
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Debug - goto and line number

Post by blueznl »

Yup, so adding a linenumber would not be that hard, now would it? ;-) <very innocent look>
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Debug - goto and line number

Post by freak »

Well, the line number information is currently not available when the debugger displays the debug message, so no promises.
quidquid Latine dictum sit altum videtur
Post Reply