[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: debugging dynamic functions
From: |
Douglas Eck |
Subject: |
Re: debugging dynamic functions |
Date: |
Wed, 07 Feb 2001 22:40:24 +0100 |
I think this is useful.
I'll add this to the still-growing octave dynamic FAQ.
-Doug
Braddock Gaskill wrote:
>
> Okay, I finally think I figured out the right way to debug dynamic
> functions. Maybe this should go in the FAQ or something, because it
> makes Octave oh-so-useful for debugging C algorithms.
>
> -Compile your .oct functions with debugging symbols (-g)
>
> -Launch and run octave under gdb (ie, `gdb octave`)
>
> -Call your dynamically linked function once so that the .oct file and
> any dependent shared libraries get loaded (is there a way to force loading?).
>
> -ctrl-C to send a trapped break signal to Octave and drop you to the gdb
> prompt
>
> -type `info shar` at the gdb prompt to see all the dynamically linked
> libraries, including your .oct file. Take note of the "Syms Read"
> column..your .oct file should say "No", meaning no symbols have been
> loaded (even if they are in the binary)
>
> -type 'share myoctavefunc.oct' to load the debugging symbols, with
> proper address translation, into gdb. Type 'info shar' again to see
> that they've been loaded.
>
> -Now add your breakpoints or whatever like your normally would. Life should
> be good.
>
> This all works for me under Linux Mandrake 7.2 with GDB 5.0. Note,
> btw, that I learned the hard way that the add-symbol-file command in
> gdb 5 is known to be broken, so you have to use 'share' and you can't
> do it by hand unles you move to a development version of gdb.
>
> BTW, I'm now using a shared lib in my .oct files very nicely with the
> mkoctfile -l command as suggested by jwe...thanks!
>
> Hope this saves people my pain!
> -Braddock
>
> --
> Invention is 99% perspiration; is it fair to patent the 1% of inspiration? -BG
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Part 1.2Type: application/pgp-signature
--
Dr. Douglas Eck, http://www.idsia.ch/~doug
Istituto Dalle Molle di Studi sull'Intelligenza Artificiale (IDSIA)
Neural Networks, Rhythm Perception and Production, Dynamical Systems
-------------------------------------------------------------
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
-------------------------------------------------------------