Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!newsfeed.internetmci.com!EU.net!peer-news.britain.eu.net!newsfeed.ed.ac.uk!hwcee!abrowne
From: abrowne@cee.hw.ac.uk (Alastair G. Browne)
Subject: Problems with Eclipse (expert help required)
Message-ID: <DJ0s3z.Bun@cee.hw.ac.uk>
Sender: news@cee.hw.ac.uk (News Administrator)
Organization: Dept of Computing and Electrical Engineering, Heriot-Watt University
X-Newsreader: TIN [version 1.2 PL2]
Date: Sun, 3 Dec 1995 16:50:23 GMT
Lines: 57

I am doing a project at University which involves the interfacing of a
C function to Prolog and the passing of integer values. I have tried
simply using a set of variables for passing to the C function and
another (same sized) set for passing back:-

[Eclipse]: c_function (A1, A2, .... ,AN, R1, R2, ... ,RN).

In C:-

c_function (vA1, tA1, vA2, tA2....etc
value vA1, vA2 ....
type tA1, tA2 ....

...using the A* values for Prolog -> C communication and R* for 
C -> Prolog. It worked for a small scale test function but when I
converted the real function to use this method Eclipse complained
about the arity (which I need to be 28 as seen from the prolog side
and 56 from the C side). Why does Eclipse appear not to support this?

I since tried using both lists and arrays, using the Eclipse manual as
a guideline, but to no avail.

I addition, how do I debug a C function using gdb or dbx that is being
called by Prolog? I want to be able to single step through it and
examine variables, preferably running the debugger through
emacs. I know about using the "-lg" option within load/1, picking up
the process ID from the name of the file in /tmp and also loading this
file (which contains the symbol table) into gdb. The Eclipse manual is
not much help, so could I have precise instructions as to command line
switches and procedures please.


The Eclipse manual is very vague on these matters and I cannot find a
reference to C/Prolog interfacing in either Bratko's or Nilsson &
Maluszynski's books.

Is there a reference manual for Eclipse that does not assume the
reader to be an expert on the internal workings of Eclipse and Prolog
in general?

I realise that this post is very long and boring but I really need to
be able to get this C/Prolog linking sussed. Whatever way I do it, I
need to be able to pass 14 integers to a C function, have the C
function change them (maybe) and communicate the changes back to
Prolog.

I would be very grateful for any assistance
--
		

		_________________________________________


		         There are things known, 
		      And there are things unknown
		      And in between are the Doors.

