[PATCH] Add WITH_DEBUG_FILES knob to enable separate debug files

Mark Johnston markjdb at gmail.com
Mon Dec 24 04:42:08 UTC 2012


On Dec 23, 2012 10:18 PM, "Garrett Cooper" <yanegomi at gmail.com> wrote:
>
> On Sat, Dec 22, 2012 at 8:13 PM, Alfred Perlstein <bright at mu.org> wrote:
> > On 12/22/12 6:14 PM, Jan Beich wrote:
> >>
> >> Ed Maste <emaste at freebsd.org> writes:
> >>
> >>> When this knob is set standalone debug files for shared objects are
> >>> built and installed in /usr/lib/debug/<so pathname>.debug.  GDB
> >>> searches this path for debug data.
> >>
> >> [...]
> >> What about ports? They are not allowed to install outside of PREFIX.
> >>
> >>    $ cd multimedia/cuse4bsd-kmod
> >>    $ make install PREFIX=/tmp/aaa PKG_DBDIR=/tmp/pkg WITH_DEBUG=
> >>    [...]
> >>    install -C -o root -g wheel -m 444   libcuse4bsd.a /tmp/aaa/lib
> >>    install -s -o root -g wheel -m 444     libcuse4bsd.so.1 /tmp/aaa/lib
> >>    install -o root -g wheel -m 444    libcuse4bsd.so.1.debug
> >> /usr/lib/debug/tmp/aaa/lib
> >>    install: /usr/lib/debug/tmp/aaa/lib: No such file or directory
> >>    *** [_libinstall] Error code 71
> >
> > I have a patch for this.  I am building world to see what happens, if
you
> > want to try it, or comment on it, please let me know.
> >
> > Changes are:
> >       base DEBUGDIR on LIBDIR for ports
> >       create intermediate directories for debug objs.
>
>     One thing about this (and the original patch) that may or may not
> make sense is that DEBUGDIR should be undefined and passed in via
> CFLAGS in the Makefile (reason being is that it would reduce
> duplication IMO and it's less duplicated magic juju hanging around
> some gdb header files).

FWIW, newer versions of gdb have done this.

>     Another thing that might be a good idea is that the changes in
> bsd.lib.mk diverge from standard expectations for the file extension
> (.symbols -> .debug), so at the very least this should be documented.
>     Finally, what about debug symbols for programs (bsd.prog.mk)? I
> assume that's coming soon, but I figured I should ask :).

I have an extension of Ed's patch which handles bsd.prog.mk at
http://people.freebsd.org/~markj/patches/debug_symbols/debug_symbols_full.patch

> Thanks!
> -Garrett
>
> PS Awesome solution for the ports issue :).
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"


More information about the freebsd-hackers mailing list