NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-amd64/50128: amd64 debug build lacks kernel debug symbols



>Number:         50128
>Category:       port-amd64
>Synopsis:       amd64 debug build lacks kernel debug symbols
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 05 12:50:00 +0000 2015
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2015.08.03.11.24.17
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

When I build a -current/i386 release using "build.sh -V MKDEBUG=yes
-V COPTS=-g release", the resulting release includes debug symbols for
both userland (as separate .debug files in the debug.tgz set) and the
kernel (within /netbsd itself).

I have used this build procedure as part of the kernel
debugging setup documented in the wiki at
https://wiki.netbsd.org/kernel_debugging_with_qemu/ .
Now that PR 49276 is fixed (go mrg!), I figured I'd try
it with the amd64 port instead of i386, but when I do that,
I end up with a kernel with no debug symbols.

>How-To-Repeat:

The following recipes do not require a particular host architecture
(or even a NetBSD host for that matter), but you do need plenty of
space in /tmp, misc/py-anita >= 1.38 and emulators/qemu from pkgsrc,
and some patience.

Working debug symbols on i386:

$ cd /usr/src
$ ./build.sh -j 4 -V MKDEBUG=YES -V COPTS="-g -fdebug-prefix-map=$(pwd)=/usr/src" -O /tmp/obj.i386 -m i386 -U release sourcesets
$ anita --workdir /tmp/work.i386 --disk-size 4G --memory-size 256M \
     --sets kern-GENERIC,modules,base,etc,comp,debug,games,man,misc,tests,text,syssrc,src,sharesrc,gnusrc \
     interact /tmp/obj.i386/releasedir/i386/
login: root
# gdb /netbsd
(gdb) l sys_sync
655     }
656     
657     /* ARGSUSED */
658     int
659     sys_sync(struct lwp *l, const void *v, register_t *retval)
660     {
661             do_sys_sync(l);
662             return (0);
663     }
664     
(gdb) <quit qemu using ctrl-a c q enter>

No debug symbols on amd64:

$ ./build.sh -j 4 -V MKDEBUG=YES -V COPTS="-g -fdebug-prefix-map=$(pwd)=/usr/src" -O /tmp/obj.amd64 -m amd64 -U release sourcesets
$ anita --workdir work.amd64 --disk-size 6G --memory-size 256M \
     --sets kern-GENERIC,modules,base,etc,comp,debug,games,man,misc,tests,text,syssrc,src,sharesrc,gnusrc \
     interact /tmp/obj.amd64/releasedir/amd64/
login: root
# gdb /netbsd
(gdb) l sys_sync
<note lack of output here>
(gdb) <quit qemu using ctrl-a c q enter>

>Fix:

Please.

>Unformatted:
 


Home | Main Index | Thread Index | Old Index