GLBasic forum

Main forum => GLBasic - en => Topic started by: ampos on 2010-Oct-14

Title: Debugger help
Post by: ampos on 2010-Oct-14
Can I insert dome kind of command, so my program stops and launch de debugger?

I know how to stop it with the "pause" button, but I want to stop it in a specific line...
Title: Re: Debugger help
Post by: Kitty Hello on 2010-Oct-14
No, but I'll add that on my todo.
Title: Re: Debugger help
Post by: Cliff3D on 2010-Oct-14
IMHO the comnmand doesn't necessarily have to be seen as a command in the source file, but that is probably the easiest way to handle it - alternatives include some kind of marker in the left margin to the left of the line that follows the "breakout" command.

I also love the idea someone posited recently of having lines drawn between matching indentations i.e a vertical line from a "FOR" down to the matching "NEXT" (and from "While" to "Wend", "IF" to "ENDIF" and so on), although that could get messy if the IDE doesn't take strict control over formatting of the source.

Is there a way to "Watch" variables? Somewhere to set a list of variables that, when in debug mode, will constantly display the variable name followed by its value for specific variables? If not I'd love to add that to my "most wanted" list - could save a great number of "DEBUG" statements in some cases.
Title: Re: Debugger help
Post by: bigsofty on 2010-Oct-14
Isn't this just a breakpoint?

Cheers,


Ian
Title: Re: Debugger help
Post by: Cliff3D on 2010-Oct-14
Yes.

Ah! IN GLBasic it's called Assert (http://www.glbasic.com/xmlhelp.php?lang=en&id=281&action=view)! :)

Thanks Ian
Title: Re: Debugger help
Post by: ampos on 2010-Oct-14
Quote from: Cliff3D on 2010-Oct-14
IMHO the comnmand doesn't necessarily have to be seen as a command in the source file, but that is probably the easiest way to handle it - alternatives include some kind of marker in the left margin to the left of the line that follows the "breakout" command.

I also love the idea someone posited recently of having lines drawn between matching indentations i.e a vertical line from a "FOR" down to the matching "NEXT" (and from "While" to "Wend", "IF" to "ENDIF" and so on), although that could get messy if the IDE doesn't take strict control over formatting of the source.

Is there a way to "Watch" variables? Somewhere to set a list of variables that, when in debug mode, will constantly display the variable name followed by its value for specific variables? If not I'd love to add that to my "most wanted" list - could save a great number of "DEBUG" statements in some cases.

That's was mee tooo  :good:
Title: Re: Debugger help
Post by: ampos on 2010-Oct-14
Quote from: Cliff3D on 2010-Oct-14
Yes.

Ah! IN GLBasic it's called Assert (http://www.glbasic.com/xmlhelp.php?lang=en&id=281&action=view)! :)

Thanks Ian

Oh, I will check that, but yesterday I did a test, and it just terminated my program, not halted it.
Title: Re: Debugger help
Post by: ampos on 2010-Oct-15
Using assert, my program just ends, do not enter in debug-motion.
Title: Re: Debugger help
Post by: Moru on 2010-Oct-15
Quote from: ampos on 2010-Oct-14
Can I insert dome kind of command, so my program stops and launch de debugger?

I know how to stop it with the "pause" button, but I want to stop it in a specific line...

Have you tried inserting a break line with F9? You can even put an IF around a line with a breakpoint to only break the program sometimes.
Title: Re: Debugger help
Post by: ampos on 2010-Oct-15
Quote from: Moru on 2010-Oct-15
Quote from: ampos on 2010-Oct-14
Can I insert dome kind of command, so my program stops and launch de debugger?

I know how to stop it with the "pause" button, but I want to stop it in a specific line...

Have you tried inserting a break line with F9? You can even put an IF around a line with a breakpoint to only break the program sometimes.

With F9 you can insert a breakpoint? Will test it. I was inserting a keywait so I can press the pause button  :whistle:
Title: Re: Debugger help
Post by: Cliff3D on 2010-Oct-15
Having just tried it... F9 sets a great breakpoint, and your variables are shown in the DEBUG pan el to the right. Lovely! Many thanks.
Title: Re: Debugger help
Post by: Moebius on 2010-Oct-20
This is also under "Edit -> Breakpoints" in the menu, with an option to clear them.  I originally found out when I missed F8.