Debugger help

Previous topic - Next topic

ampos

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...

Kitty Hello

No, but I'll add that on my todo.

Cliff3D

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.

bigsofty

Isn't this just a breakpoint?

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Cliff3D

#4
Yes.

Ah! IN GLBasic it's called Assert! :)

Thanks Ian

ampos

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:

ampos

Quote from: Cliff3D on 2010-Oct-14
Yes.

Ah! IN GLBasic it's called Assert! :)

Thanks Ian

Oh, I will check that, but yesterday I did a test, and it just terminated my program, not halted it.

ampos

Using assert, my program just ends, do not enter in debug-motion.

Moru

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.

ampos

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:

Cliff3D

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.

Moebius

#11
This is also under "Edit -> Breakpoints" in the menu, with an option to clear them.  I originally found out when I missed F8.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary