splitdebug

Sometimes when you go looking for answers you find hidden gems.

I absolutely love the “splitdebug” feature (that’s FEATURES of the make.conf variety). I didn’t even know it existed until I read up on some changed documentation. It doesn’t seem to be listed in the make.conf.example, unfortunately.

See, this neato thing will cause your program to build in the debugging symbols, then in the end strip them out and put them into a separate file inside of /usr/lib/debug. This means your main binaries and libraries maintain their minimal size and memory footprint as though they were stripped (which happens by default, unless you’re a nostripper like I was). And all of the juicy tidbits of debugging symbols get tucked away until you need them. No more having to re-emerge packages with the debug flag just to get the symbols, then re-emerge them later to get back to the minimal sizes.

I’m completely grateful to whomever added this nitfy feature to portage. You are my hero.

9 Responses to “splitdebug”

  1. bigD Says:

    Does this blog translate to english?

  2. Uzytkownik Says:

    I also like this very much. I get known of it when I ask about similar feature on bugzilla.

    One problem - Sometimes I mistake step/next and I debug glibc instead of by program…

  3. Diego Flameeyes Pettenò Says:

    Actually, even while using the nostrip FEATURE, the memory footprint of processes does not change, as only the PT_LOAD sections are loaded (debug sections aren’t).

    There are, though, many other reasons to use splitdebug over nostrip. I wrote about that in the backtraces guide.

  4. REdOG Says:

    Its small features(read: innovations) like this that brought me to love gentoo. Choice >= Default

  5. taviso Says:

    I think solar is the man to thank, we were just discussing this one day (external symbol file support in gdb) and asking why dont we use this great feature?! 10 minutes later he had a patch ready to go ;)

    Uzytkownik: actually, thats not true. while implementations are permitted to do that, linux doesnt for performance reasons and simply maps the whole thing in.

  6. taviso Says:

    uhh, previous reply was to Diego :)

  7. celeb Says:

    Taviso: I first learned about this in Qt-4.2 where they added the ability to split debug symbols out of the libraries into separate files. I thought it was brilliant. Now to see it’s automated it portage is fantastic!

  8. bradmw Says:

    “installsources” fits nicely with splitdebug when debugging packages. GDB can show source sections and creating TAGS for the installed sources is nice for editing.

  9. solar Says:

    You are welcome

Leave a Reply