Breakpoint properties and conditions

Discussions related to Visual Prolog
Peter Muraya
VIP Member
Posts: 146
Joined: 5 Dec 2012 7:29

Breakpoint properties and conditions

Unread post by Peter Muraya » 11 Sep 2015 5:36

Hi,
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?
Attachments
break_properties.png
break_properties.png (8.44 KiB) Viewed 5593 times
Mutall Data Management Technical Support

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 11 Sep 2015 9:07

Comment also appears in the breakpoint window, where it may be more relevant.

The action field is a non-documented and unsupported feature.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy » 14 Sep 2015 5:07

The action field is a non-documented and unsupported feature.
Does it work at all?
Is it really non-documented?
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Re:

Unread post by Thomas Linder Puls » 14 Sep 2015 11:22

Ferenc Nagy wrote:Does it work at all?
Yes, but it is unsupported.
Ferenc Nagy wrote:Is it really non-documented?
Yes.
Regards Thomas Linder Puls
PDC

Peter Muraya
VIP Member
Posts: 146
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya » 23 Sep 2015 17:37

Thomas,
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?
Attachments
break.png
break.png (155.08 KiB) Viewed 5522 times
break2.png
break2.png (125.29 KiB) Viewed 5522 times
Mutall Data Management Technical Support

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 23 Sep 2015 19:04

Regards Thomas Linder Puls
PDC

Peter Muraya
VIP Member
Posts: 146
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya » 24 Sep 2015 5:13

Thanks Thomas.
I see; with core::nothing(...) my concerns are sufficiently addressed.
Mutall Data Management Technical Support

Harrison Pratt
VIP Member
Posts: 283
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt » 24 Sep 2015 21:45

Thanks, Thomas, and thanks also to Peter for starting this thread. There will be dancing in the streets!

Peter Muraya
VIP Member
Posts: 146
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya » 25 Sep 2015 10:07

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.
Mutall Data Management Technical Support

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 25 Sep 2015 13:15

The mentioned video is on youtube: Dump Demo - Visual Prolog 7.3 - IDE demonstration.
Regards Thomas Linder Puls
PDC

Post Reply