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

Home » Public Forums » archive » Re: how to debug IDL with 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
Re: how to debug IDL with call_external? [message #18380] Mon, 03 January 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Nando <f.iavarone@acsys.it> writes:
> pei zeng wrote:
>
>> I have an IDL application which calls a FORTRAN code(quite large). When I
>> run it, it crashed the application and would not allow me to debug the
>> fortran code.
>
> Have you tried to use a debugger?
> I work with call_external of C code and I use dbx for debugging.
> I run the dbx after IDL launching (on the process id of IDL).
> After your code has linked the shared object, set a break point on your
> external code and
> it is possible to trace the execution.

In developing XFILTER, a devious add-on to IDL, I did a lot of
debugging. I found that using the debugger worked fine and I could
set breakpoints within my own code. In my case I used GDB on C code
but any debugger that normally works should be okay for you. However,
there are a few gotchas:

* of course, you need to compile with debugging support.

* you should be careful to debug the binary executable and not the
script which is normally run. Usually this means that you have to
set a few environment variables that the script would normally set,
and then run the debugger on $IDL_DIR/bin/bin.arch/idl where arch
is your architecture.

* there is a chicken/egg problem regarding loaded programs. The
debugger won't know about your program until the object file is
loaded; BUT you can't load your program without first running IDL.
Therefore you can't immediately set a breakpoint on your first run.

Usually I get around this by having a "dummy" function which does
nothing. By CALL_EXTERNALing this dummy function, the object file
is forced to be loaded. After that you can pop back to the
debugger and set breakpoints within your code.

Good luck,

Craig

P.S. XFILTER is a graphics driver for Unix versions of IDL which
saves entire graphics streams for subsequent playback. Equivalent to
David's XWINDOW but much more straightforward. Find it here:

http://cow.physics.wisc.edu/~craigm/idl/idl.html (look for XFWINDOW)

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Xinteranimate problem!!
Next Topic: Re: Surface Rendering from Stereo-pairs

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

Current Time: Sat Oct 11 15:13:28 PDT 2025

Total time taken to generate the page: 0.64229 seconds