help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging dynamic functions


From: John W. Eaton
Subject: Re: debugging dynamic functions
Date: Wed, 7 Feb 2001 13:43:02 -0600

On  7-Feb-2001, Joshua Rigler <address@hidden> wrote:

| "John W. Eaton" wrote:
| > ...snip...
| >
| > 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.
| 
| Huh?  I didn't think this was possible after reading up on the package
| mathwrap and its "-stub" option, but as many have come to realize, I
| misinterpret/misunderstand things quite often ;^).
| 
| If I understand what you're saying, this might solve some of my problems
| developing CDF routines.  Would you (jwe) be willing to provide a VERY
| brief example of how you do what you've described above?  Thanks.

Look at the way the getpwent.cc file is written (for example).
It includes multiple DLD functions.  To access the additional
functions, you create hard links that match the additional names.
After Octave is installed, you should have something like

  $ ls -li | sort -n
   ...
   351002 -rwxr-xr-x    5 root     root        17668 Dec 10 21:45 endpwent.oct
   351002 -rwxr-xr-x    5 root     root        17668 Dec 10 21:45 getpwent.oct
   351002 -rwxr-xr-x    5 root     root        17668 Dec 10 21:45 getpwnam.oct
   351002 -rwxr-xr-x    5 root     root        17668 Dec 10 21:45 getpwuid.oct
   351002 -rwxr-xr-x    5 root     root        17668 Dec 10 21:45 setpwent.oct
   ...

(note the inode number -- all of these file names refer to the same
file).  When Octave loads one of them, it remembers that it has a
shared library loaded.  The next time it searches for a name, it tries
to find it in the already loaded files first.  If you clear all the
functions loaded from a file, it is unloaded.  If you update the
functions and call one of them again, Octave should notice, clear all
the related function names from the symbol table, unload the .oct
file, then reload the new one (this works on some systems, anyway).

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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]