Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Sep 2005 10:56:13 -0700
From:      "David O'Brien" <obrien@FreeBSD.org>
To:        Ruslan Ermilov <ru@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf kern.post.mk
Message-ID:  <20050913175613.GA18137@dragon.NUXI.org>
In-Reply-To: <20050913085848.GG37280@ip.net.ua>
References:  <20050911002229.51F4916A471@hub.freebsd.org> <432382BC.5080105@root.org> <20050911023622.GA51877@dragon.NUXI.org> <4324A665.3070405@root.org> <20050912010034.GA77819@dragon.NUXI.org> <20050913071031.GE37280@ip.net.ua> <20050913085848.GG37280@ip.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 13, 2005 at 11:58:48AM +0300, Ruslan Ermilov wrote:
> To address all of this, I suggest to revert kern.post.mk to rev. 1.83
> and just make INSTALL_DEBUG the default in HEAD when DEBUG is also
> set.  Should this be also true for modules, I'm not sure.
..
> The only change in behavior would be that installkernel.debug now
> installs *both* normal and debug versions, while previously it only
> installed debug versions.

1. We can still have the confusion of how to provide a usable traceback.
The poster will have to know to kgdb kernel.debug vs. kernel.
2. Why install a file that is a complete copy of another and then extra
needed information?  Instead just install the fuller copy.  Those
suffering from small / partitions will have even more pressure installing
an extra 6.7MB.

Please remember the purpose of this is to get better bug reports on
-CURRENT.  While still trying to strike a balance with disk space and
usability.

Here is a patch that separates out the symbols into its own file and
installs them beside the now stripped kernel executable.  I've minimally
tested in on i386 with 'kgdb' and 'gdb6 -k'.

Index: kern.post.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kern.post.mk,v
retrieving revision 1.84
diff -u -u -2 -r1.84 kern.post.mk
--- kern.post.mk	11 Sep 2005 00:22:21 -0000	1.84
+++ kern.post.mk	13 Sep 2005 17:46:48 -0000
@@ -83,7 +83,7 @@
 	@echo linking ${.TARGET}
 	${SYSTEM_LD}
-.if !defined(DEBUG)
+	${OBJCOPY} --only-keep-debug ${.TARGET} ${.TARGET}.symbols
 	${OBJCOPY} --strip-debug ${.TARGET}
-.endif
+	${OBJCOPY} --add-gnu-debuglink=${.TARGET}.symbols ${.TARGET}
 	${SYSTEM_LD_TAIL}
 
@@ -181,4 +181,10 @@
 .endif
 
+.if defined(DEBUG) && !defined(NO_INSTALL_KERNEL_SYMBOLS)
+KERNEL_FILES=	${KERNEL_KO} ${KERNEL_KO}.symbols
+.else
+KERNEL_FILES=	${KERNEL_KO}
+.endif
+
 kernel-install:
 	@if [ ! -f ${KERNEL_KO} ] ; then \
@@ -201,5 +207,5 @@
 .endif
 	mkdir -p ${DESTDIR}${KODIR}
-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
+	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_FILES} ${DESTDIR}${KODIR}
 
 kernel-reinstall:

-- 
-- David  (obrien@FreeBSD.org)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050913175613.GA18137>