Page 1 of 1

Debug - goto and line number

Posted: Sun Mar 21, 2010 2:29 pm
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.

Re: Debug - goto and line number

Posted: Sun Mar 21, 2010 2:37 pm
by Kaeru Gaman
my debugger does not have a timestamp... o.O

Re: Debug - goto and line number

Posted: Sun Mar 21, 2010 2:39 pm
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.

Re: Debug - goto and line number

Posted: Sun Mar 21, 2010 3:27 pm
by #NULL
i guess he means the error log (preferences > debugger > individual settings > display debug output in the error log)

Re: Debug - goto and line number

Posted: Sun Mar 21, 2010 4:56 pm
by freak
The time stamp is optional. Its in the preferences.

Re: Debug - goto and line number

Posted: Sun Mar 21, 2010 8:43 pm
by blueznl
Yup, so adding a linenumber would not be that hard, now would it? ;-) <very innocent look>

Re: Debug - goto and line number

Posted: Sun Mar 21, 2010 9:25 pm
by freak
Well, the line number information is currently not available when the debugger displays the debug message, so no promises.