Page 1 of 1

Breakpoint properties and conditions

Posted: 11 Sep 2015 5:36
by Peter Muraya
I was looking for a way of specifying a condition for stopping at a breakpoint when I opened its properties. I found 2 fields: comment and action.
The comment is the text that appears when you hover over the breakpoint marker; has anybody found this to be useful?
What about action? What is it intended for? What do I type in there?
Is it possible to specify a break condition at all?

Posted: 11 Sep 2015 9:07
by Thomas Linder Puls
Comment also appears in the breakpoint window, where it may be more relevant.

The action field is a non-documented and unsupported feature.

Posted: 14 Sep 2015 5:07
by Ferenc Nagy
The action field is a non-documented and unsupported feature.
Does it work at all?
Is it really non-documented?


Posted: 14 Sep 2015 11:22
by Thomas Linder Puls
Ferenc Nagy wrote:Does it work at all?
Yes, but it is unsupported.
Ferenc Nagy wrote:Is it really non-documented?

Posted: 23 Sep 2015 17:37
by Peter Muraya
The first attachment shows a point in the code where I want to break and observe certain variables under some condition. The problem is that very often I have to Debug Run very many times before I get to the condition of interest (and that is tiresome). I solve this by doing what is illustrated in the 2nd attachment: adding an if statement and breaking on the desired condition. This happens so often (and sometimes I forget to remove the extra code after debugging) that I wish conditional breaking was supported. Is there an alternative to my approach? Is it likely that future versions of Prolog will support conditional breakpoints?

Posted: 23 Sep 2015 19:04
by Thomas Linder Puls

Posted: 24 Sep 2015 5:13
by Peter Muraya
Thanks Thomas.
I see; with core::nothing(...) my concerns are sufficiently addressed.

Posted: 24 Sep 2015 21:45
by Harrison Pratt
Thanks, Thomas, and thanks also to Peter for starting this thread. There will be dancing in the streets!

Posted: 25 Sep 2015 10:07
by Peter Muraya
Thank you Harrison.
When I got this response from Thomas, I searched this forum for further tips on debugging. I found 2 that I think are very useful.

The first one was Run in Window which allows me to see outputs without having to always include a readchar()=_ as in this sample:-

Code: Select all

run() :-          X= array2M{integer}::newAtomic(2,2),          I = X:get(0,0),          stdio::write(I).,          stdio::readChar()=_.
The second one was a way of navigating the code while not running it (in a way I was not aware of): Go to Position on Clipboard.. Thomas has a video that explains it very well.

Posted: 25 Sep 2015 13:15
by Thomas Linder Puls
The mentioned video is on youtube: Dump Demo - Visual Prolog 7.3 - IDE demonstration.