Re: [eclipse-clp-users] exception details in embedded eclipse

From: Joachim Schimpf <jschimpf_at_...311...>
Date: Fri, 13 Dec 2013 13:56:53 +0000
On 12/12/2013 19:34, Federico Ferri wrote:
> Greetings,
> is there a way to get the exception details in embedded eclipse?
> if an error happens in the prolog program, I can notice it because resume() returns THROW, but
> often the argument* associated with this return code it's just 'abort', which makes debugging more
> difficult.

The native ECLiPSe error handling mechanism prints an error message
to the error-stream, and then, as you say, executes throw(abort).

So, for debugging, the first thing is to make sure you can see the
error output, even in your embedded setting.

A second recommendation is to develop and debug the ECLiPSe components
of your application outside the embedded situation, e.g. using tkeclipse.
Obviously there are limits to this, but it will probably save you time
in the end.

If you are developing a larger embedded application, then it is also
worth employing the remote development tools via lib(remote_tools)
This allows you to use the tool-components of tkeclipse (tracer etc)
to debug your embedded application.  I'm using this at the moment
for an embedded Java application, and it works quite well.
It isn't terribly well documented though, so here are the basics:

To prepare for debugging, your application code should execute
remote_tools:tools.  This should open a small tktools window (*),
from which you can open the tracer etc, and the resume ECLiPSe.
In my Java application, I have made a menu entry for doing that.

Then, the part of your application that you want to debug must
be called with trace/1 or debug/1
which will activate the tracer when executed.

(*) This works since ECLiPSe 6.1 #173 (for Windows) and #176 (Linux).
You can test it by calling remote_tools:tools from a command line
eclipse. If it doesn't work, you have to start tktools manually, and
connect it to your embedded ECLiPSe using attach_tools/0 (see docs).

Received on Fri Dec 13 2013 - 13:57:15 CET

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:30 CEST