[PD-dev] debugging pd with gdb or ddd

Hans-Christoph Steiner hans at eds.org
Sun May 28 00:39:44 CEST 2006


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





More information about the Pd-dev mailing list