debugging a c-code called by CALL_EXTERNAL [message #70094] |
Fri, 12 March 2010 03:51 |
simona bellavista
Messages: 56 Registered: December 2009
|
Member |
|
|
Hi!
I tried to link a c shared library in idl by call_external. In the end
I managed to do it but it has been quite a pain. The library was
working fine if called inside a c code, but when I called it from idl
I got a 'segmentation fault', and idl was forced to quit
immediately. It turned out the problem was that I had defined a
routine
int index(const int , const int)
inside my lib, but this definition was conflicting with another
definition in idl; when I was dereferencing a pointer
a[index(i,j)]
this gave me segmentation fault, obviously. I changed the function
name and everything was solved.
I was not aware of this because I didn't include idl_external.h in the
library, now I have learnt it must always be included. ok , fine.
The question is : how do I debug a c-code from idl? in this case the
c-code was fine by itself, the problem arose just when it was called
from idl, what can I do if I want to examine variables' values? As
stated in the idl reference guide "Input and output actions should be
performed within IDL code" so printf is not an option.
Cheers,
Simona
|
|
|