Hallo!
How do you get gdb to find the sources for externals? It seems to find the Pd source fine, but not the source the objects I am working on.
hm ... you are right, break file:nr also doesn't work for me ... I just read somewhere that maybe you can set "break main" and then when the program stops set the breakpoints for the libraries ... but I don't know ...
What platform are you on? I am on Mac OS X.
debian on a pc
LG Georg
Get ready to laugh... when I need to run gdb on an extern, I just link the thing into Pd, debug it, and then take it back out. Easier than figuring out how to get gdb to see dlopen()-ed code...
cheers Miller
On Sat, May 27, 2006 at 10:39:40AM +0200, Georg Holzmann wrote:
Hallo!
How do you get gdb to find the sources for externals? It seems to find the Pd source fine, but not the source the objects I am working on.
hm ... you are right, break file:nr also doesn't work for me ... I just read somewhere that maybe you can set "break main" and then when the program stops set the breakpoints for the libraries ... but I don't know ...
What platform are you on? I am on Mac OS X.
debian on a pc
LG Georg --
Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
On Sat, 27 May 2006, Miller Puckette wrote:
Get ready to laugh... when I need to run gdb on an extern, I just link the thing into Pd, debug it, and then take it back out. Easier than figuring out how to get gdb to see dlopen()-ed code...
type this in gdb:
add-symbol-file my_blah.pd_linux
it's the second line when you type this other gdb command:
help files
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
On May 27, 2006, at 9:59 PM, Mathieu Bouchard wrote:
On Sat, 27 May 2006, Miller Puckette wrote:
Get ready to laugh... when I need to run gdb on an extern, I just link the thing into Pd, debug it, and then take it back out. Easier than figuring out how to get gdb to see dlopen()-ed code...
type this in gdb:
add-symbol-file my_blah.pd_linux
it's the second line when you type this other gdb command:
help files
You win the prize!!!
It worked, breakpoint and all. Now I need to learn gdb. Anyone know a good, quick gdb intro? Its been 10+ years since I used it.
Here's a little transcript:
(gdb) attach pd.11 11790 11832 (gdb) attach pd.11832 Attaching to program: `/Applications/Pd-0.39.2-extended-test3.app/ Contents/Resources/bin/pd', process 11832. Reading symbols for shared libraries ..........................................ad.....d.....-.s. . ................. done 0x9001f5ec in select () (gdb) add-symbol-file hid.pd_darwin add symbol table from file "hid.pd_darwin"? (y or n) y Reading symbols from /Users/hans/cvs/pure-data/externals/hcs/hid/ hid.pd_darwin...done. (gdb) break hid_free Breakpoint 1 at 0x1012384: file /Users/hans/cvs/pure-data/ externals/../externals/hcs/hid/hid.c, line 359. (gdb) continue Continuing.
Breakpoint 1, hid_free (x=0x659f80) at /Users/hans/cvs/pure-data/ externals/../externals/hcs/hid/hid.c:359 359 debug_print(LOG_DEBUG,"hid_free"); (gdb) step debug_print (message_debug_level=7, fmt=0x10220e4 "hid_free") at / Users/hans/cvs/pure-data/externals/../externals/hcs/hid/hid.c:62 62 if(message_debug_level <= global_debug_level)
.hc
________________________________________________________________________ ____
"Terrorism is not an enemy. It cannot be defeated. It's a tactic. It's about as sensible to say we declare war on night attacks and expect we're going to win that war. We're not going to win the war on terrorism." - retired U.S. Army general, William Odom
On Sun, 2006-05-28 at 00:39 +0200, Hans-Christoph Steiner wrote:
Get ready to laugh... when I need to run gdb on an extern, I just link the thing into Pd, debug it, and then take it back out. Easier
than
figuring out how to get gdb to see dlopen()-ed code...
type this in gdb:
add-symbol-file my_blah.pd_linux
it's the second line when you type this other gdb command:
help files
You win the prize!!!
it should be possible to run an embedded gdb in about every editor, that's designed for writing source code ... i've been running gdb within emacs and eclipse and i guess, other ide's like vi(m), kdevelop offer similar features (well, maybe not nano or pico) setting a breakpoint in emacs/gud is as simple as typing C-x space ....
hth ... tim
-- TimBlechmann@gmx.de ICQ: 96771783 http://www.mokabar.tk
Life is really simple, but we insist on making it complicated. Confucius
On May 28, 2006, at 9:21 PM, Tim Blechmann wrote:
On Sun, 2006-05-28 at 00:39 +0200, Hans-Christoph Steiner wrote:
Get ready to laugh... when I need to run gdb on an extern, I just link the thing into Pd, debug it, and then take it back out. Easier
than
figuring out how to get gdb to see dlopen()-ed code...
type this in gdb:
add-symbol-file my_blah.pd_linux
it's the second line when you type this other gdb command:
help files
You win the prize!!!
it should be possible to run an embedded gdb in about every editor, that's designed for writing source code ... i've been running gdb within emacs and eclipse and i guess, other ide's like vi(m), kdevelop offer similar features (well, maybe not nano or pico) setting a breakpoint in emacs/gud is as simple as typing C-x space ....
I started a wiki page to start documenting this and filled in my session. More info would be greatly appreciated.
http://puredata.org/docs/developer/UsingGdbToDebugPdExternals
.hc
________________________________________________________________________ ____
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin