[eclipse-clp-users] switching debugger on with trace

From: Chris Meudec <Chris.Meudec_at_...438...>
Date: Thu, 15 Dec 2022 10:34:53 +0000
I am reacquainting myself with ECLiPSe 7.0 after playing with SICSTUS for a while...

I SICSTUS I can insert a call to the predicate 'trace' anywhere in my code, and the debugger will awake and waits for my instructions there.

In ECLiPSe, trace seems to be a command, not a predicate, so I cannot do the same.
spy/1 must be applied to a whole predicate so it cannot be used to switch the debugger in between predicate calls. set_flag/3 also require a predicate

The best I can do to replicate that behaviour (after an hour of experimentation!) is to create my own mytrace/0 predicate:

p :- big_goal1, mytrace, buggy_goal, big_goal2.

big_goal1.
buggy_goal.
big_goal2.

mytrace.
:- spy mytrace/0.

This works as expected: the debugger switches itself on and I can creep through the rest of the code.
I could not get debug/1 on its own nor with set_flag/3 to work.


Is there a better way?

Thanks,
Chris
--
Dr Chris Meudec<http://www.echancrure.eu/> (he/him) Maitrise, PhD, MA (T&L)
Lecturer in Software Development
E chris.meudec_at_...438...<mailto:chris.meudec_at_...438...> |  setu.ie<https://setu.ie/>
[turn on images]<https://setu.ie/>

Kilkenny Road Campus, Kilkenny Road, Carlow, R93 V960, Ireland
Campas Bhóthar Chill Chainnigh, Bóthar Chill Chainnigh, Ceatharlach, R93 V960, Éire
Received on Thu Dec 15 2022 - 15:09:41 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST