Building ports in debug mode

Lately, Amarok’s Ipod handling has been acting up — Amarok crashes immediately when trying to add music to the Ipod.

So, I wanted to do some debugging using the gnu debugger (gdb) to figure out what’s wrong, but I forgot to build Amarok with the debugging symbols.

There’s more than one way to do it.  I can set options in /etc/make.conf (which sets build options globally), or I can set the debug option at build time for just Amarok.  I decided to do the 2nd one, since everything else is working.

To set build options on a port, you use the -D flag, and specify the variable, so in my case it’s the DEBUG flag.

So:

cd /usr/ports/audio/amarok
make install -D DEBUG

[wait for the compiler to do its thing]

then I’ll run

gdb amarok

)run

and we’ll see what’s up.  If you wanted to run debugging for all your port builds, apparently you can set the variable
DEBUG_FLAGS=-g

in /etc/make.conf

Posted by Scott in Uncategorized

Leave a Reply

 
  • jacob: Thanks for a great post. I had one issue with your command: #nice -n 10 portupgrade -aRr. you will get...
  • Pan: Do you have any problem printing from a windows machine? I have an Samsung ML1610 and I can print once from...
  • Scott: One other item. CUPS. To get this working right, I edited /usr/local/etc/cups/cupsd.conf , and added the line...
  • Scott: Follow-up item: after disabling nmbd as the Section 6 wiki mentioned, I found that I could no longer access...
  • Scott: Dan, that’s a great point. I experienced exactly what you’re saying today when I realized...