Re: [eclipse-clp-users] Debugging and Development

From: Kish Shen <kisshen_at_...5...>
Date: Fri, 12 Mar 2010 23:46:01 +0000
Christian Wirth wrote:
> I'm currently using a text editor and the eclipse tracer/inspector for 
> debugging .. but i find this very annoying, because i'm missing several 
> features that i'm used to have from other development platforms (..like 
> Eclipse for Java).
> 
> At first, i want to know if there is a special Prolog development editor 
> ? found one for Eclipse but that does not support EclipseCLP. I only 
> want some simple features like auto completation, syntax highlighting, 
> call hierarchy, syntax checking ...
> What is everyone else using ?

I guess you are used to using an IDE for development program. As you 
say, TkECLiPSe does not provide an integrated editor, instead, you can 
use your own editor (this is a different development model -- in that 
you learn to use a particular editor, which you can then use to edit 
different programming language and other things). However, you can 
download various support packages for some popular (for Un*x, anyway) 
editors, that provide things like syntax highlighting etc. The one that 
probably provides most features is the support for the emacs editor, 
which provides quite a bit more than syntax highlighting [this is what I 
use]. You can download these support packages from ECLiPSe's 
source-forge download site:

http://sourceforge.net/projects/eclipse-clp/files/

You mention the Eclipse IDE for Java. There is an ECLiPSe plugin
for Eclipse -- Saros. You can also find this at the source-forge 
download site. It provides the same set of tools as TkECLiPSe, and you 
use the Eclipse editor to do your editing, but as far as I know, there 
is not really much ECLiPSe specific enhancements for the editor.


> Additional better debug capabilitys would be very handy ... but i assume 
> there is no other debugger ? But i hope there is a solution to a debug 
> problem i have very often:
> When i get a "real" error, not something like predicate not found (a.E 
> instantiation fault in call(_8087) ), i want to know where and when .. 
> how to ?
> 

The most common type of bugs that people run into is the program behave 
differently from what they expect, e.g. it gives the wrong answer (or 
simply fails). However, from what you are saying, the errors you are 
having are when ECLiPSe aborts with an error message, and these error 
messages don't give you information on where in your source the error 
is. The reason is that the system actually doesn't have the information 
when the error is handled.

You can use the 'analyze failure' feature of the TkTracer to pin-point 
the error. When you are running your program with the tracer, and an 
error occurs, the tracer will stop at a 'LEAVE' port (if you were 
leaping when the error occur, the LEAVE port will be at the last 
predicate that had a spy-poiny on it). You can select 'analyze failure' 
(from the Options menu), which will give the invocation number for the 
last failure (or abort, in this case), which should be your error.

You can now rerun your program, and jumping to this invocation number 
should take you to where the error is handled. The code that actually 
caused the error occur a bit earlier, so you should jump to a slightly 
earlier (i.e. smaller) invocation number, this should take you to code 
just before the error.

Cheers,

Kish

_______________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Fri Mar 12 2010 - 23:46:17 CET

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