Gnu has the Data Display Debugger, or ddd, and I even found an article in English about it. I was going to ignore it for my chapter on debugging in Mastering Perl until I saw that Peter Scott showed it breifly in Perl Debugged.
After much yak shaving last night (fix my FreeBSD routing table so I could cvsup ports so I could compile gcc34 so I could compile ddd), and much online poker playing while the compilation was under way (won one tournament, second in two others, final table in another, and a miserable 48th in the last one, up 15,000 play chips by the end), I got this thing install. With more yak shaving to let my FreeBSD machine display thing on my Powerbook (not sure I had to use xhost last time I did this, odd) because my Intel laptop's monitor flickered a moment then never came back. It isn't fun editing /etc/rc.conf to set the defaultrouter when I can't see the screen. Some of you might really like the challenge, but I think it sucked. Although, punching the screen won't break it any worse. :)
So, does anyone use this? Does anyone happen to have the Mac OS X binary that seems to have disappeared from the net?
Aside from that, what else might you be using as a debugger or IDE? I know about Komodo, EPIC, and Affrus. What else is out there?
Re:Used it for debugging C
brian_d_foy on 2006-10-02T19:04:35
I won't cover XS debugging since I'm not covering XS stuff (leaving that to Extending and Embedding Perl), but what's your trick?:) Re:Used it for debugging C
shild on 2006-10-03T14:04:49
Here are the instructions I got. This has saved me a lot of debugging time.
#################################################
set the env var PASTHRU_INC when compiling your extension:
$ # turn on debugging symbols, turn off optimization (to
$ # prevent out-of-order execution that makes debugging
$ # rather confusing)
$ export PASTHRU_INC='-Wall -g -O0'
then you can run your program in gdb and be taken to the exactly right
spot when it crashes. you can inspect all of the values to find out
what happened.
some versions of gdb don't get things right when you try to set a
breakpoint in a module that isn't loaded yet, and since xs modules are
dynamic objects then you run into this a lot. i get around this by
running the perl debugger inside gdb.
$ gdb perl
(gdb) set args -d mycoolscript.pl
(gdb) run
DB # break here to get back to gdb
DB ^C
(gdb) # set the breakpoint where you want... C function...
(gdb) break gtk_main
(gdb) # or the xsub
(gdb) break XS_Gtk2_main
(gdb) # go back to perl
(gdb) continue
DB # carry on
DB c...
Breakpoint 1, XS_Gtk2_main (my_perl=0x800200, cv=0x8c1434) at
xs/Gtk2.c:381
381 dXSARGS;
(gdb)