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

Breakpoint properties and conditions

Unread post by Peter Muraya »

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 16867 times
Mutall Data Management Technical Support
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post 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.
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

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: 1398
Joined: 28 Feb 2000 0:01

Re:

Unread post 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?
Yes.
Regards Thomas Linder Puls
PDC
Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya »

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 16796 times
break2.png
break2.png (125.29 KiB) Viewed 16796 times
Mutall Data Management Technical Support
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Regards Thomas Linder Puls
PDC
Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya »

Thanks Thomas.
I see; with core::nothing(...) my concerns are sufficiently addressed.
Mutall Data Management Technical Support
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

Thanks, Thomas, and thanks also to Peter for starting this thread. There will be dancing in the streets!
Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Unread post 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.
Mutall Data Management Technical Support
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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