comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » debugging a c-code called by CALL_EXTERNAL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
debugging a c-code called by CALL_EXTERNAL [message #70094] Fri, 12 March 2010 03:51
simona bellavista is currently offline  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
[Message index]
 
Read Message
Previous Topic: Re: Rebin for strings
Next Topic: Re: HDF5 crash on macOS

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 11:05:22 PDT 2025

Total time taken to generate the page: 1.12094 seconds