[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
debugging dynamic functions
From: |
John W. Eaton |
Subject: |
debugging dynamic functions |
Date: |
Wed, 7 Feb 2001 11:51:14 -0600 |
On 7-Feb-2001, Braddock Gaskill <address@hidden> wrote:
| Three questions:
|
| 1) What is the proper way to debug dynamically loaded octave
| functions using gdb?
I've had success starting gdb, running Octave, calling the function
once to load it, then simply setting a breakpoint in it. The function
name is mangled by prepending an F to whatever you used in the
DEFUN_DLD macro. So if you write
DEFUN_DLD (my_fun, , , ...
the actual function name will be Fmy_fyn.
| 2) What is the 2.0.16 and 2.1.x behavior for loading and unloading
| DL functions?
I think they should behave similarly. Do you have a more specific
question?
| 3) What is the proper way to have .oct files pull in an outside library
| they are dependant on?
Link only to shared libraries and add -lyour-library to the mkoctfile
command (or equivalent commands you run yourself or via make or
whatever). How these are resolved and loaded may be system dependent
though.
| A few years ago, I seem to remember that once I called a DL function
| in octave, it stayed loaded, which actually caused symbol problems
| because I had multiple DL functions which were glue to a single static
| library of routines, so I statically linked one function which I ran
| first. Since then, the behavior seems to have changed: I can now
| statically link the same library with a set of DL function .oct files
| and not have any symbol conflicts. Will having the .oct files link to
| a shared library work? I was assuming Octave now unloads the DLF
| right after the call is made now? Is there a clean way to do this?
The .oct file is only unloaded after all the functions defined from it
are cleared. If you have multiple routines that are supposed to share
a library of functions, you might want to define them all in one .oct
file. A .oct file that contains multiple DLD functions should only be
loaded once now.
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------