Module Name:    src
Committed By:   christos
Date:           Mon Dec 20 14:41:26 UTC 2021

Modified Files:
        src/etc: Makefile
        src/share/mk: bsd.README bsd.own.mk

Log Message:
PR/55557: Andreas Gustafsson" Introduce a new variable MKDEBUGKERNEL which
as the name implies, includes a netbsd.gdb inside each kernel set:
$ tar -tzvf kern-GENERIC.tgz
-rwxr-xr-x  0 root   wheel 29398264 Dec 19 12:50 ./netbsd
-rwxr-xr-x  0 root   wheel 208125880 Dec 19 12:50 ./netbsd.gdb


To generate a diff of this commit:
cvs rdiff -u -r1.452 -r1.453 src/etc/Makefile
cvs rdiff -u -r1.425 -r1.426 src/share/mk/bsd.README
cvs rdiff -u -r1.1270 -r1.1271 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.452 src/etc/Makefile:1.453
--- src/etc/Makefile:1.452	Sun Sep 26 11:52:40 2021
+++ src/etc/Makefile	Mon Dec 20 09:41:26 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.452 2021/09/26 15:52:40 maya Exp $
+#	$NetBSD: Makefile,v 1.453 2021/12/20 14:41:26 christos Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -590,6 +590,7 @@ build_kernels: .PHONY
 build_kernels: kern-${configfile}
 kern-${configfile}: .PHONY .MAKE
 	cd ${KERNCONFDIR} && ${TOOL_CONFIG} ${CONFIGOPTS} -s ${KERNSRCDIR} \
+	    ${MKDEBUGKERNEL == "yes" :? -DDEBUG=-g :} \
 	    -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
 .if ${MKUPDATE} == "no"
 	${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} distclean
@@ -622,6 +623,9 @@ kernset-${configfile}: .PHONY build_kern
 				kernels="$${kernels} $${ks}"; \
 				[ -z "$${newest}" -o $${ks} \
 				    -nt "$${newest}" ] && newest=$${ks}; \
+				[ ${MKDEBUGKERNEL} = "no" -o \
+				     ! -f $${ks}.gdb ]  continue; \
+				kernels="$${kernels} $${ks}.gdb"; \
 			done; \
 		done; \
 		[ $${kern_tgz} -nt "$${newest}" ] || { \

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.425 src/share/mk/bsd.README:1.426
--- src/share/mk/bsd.README:1.425	Sun Dec  5 02:53:57 2021
+++ src/share/mk/bsd.README	Mon Dec 20 09:41:26 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.425 2021/12/05 07:53:57 msaitoh Exp $
+#	$NetBSD: bsd.README,v 1.426 2021/12/20 14:41:26 christos Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -185,6 +185,9 @@ MKDEBUGLIB	Build *_g.a debugging librari
 		with -DDEBUG.
 		Default: no
 
+MKDEBUGKERNEL	Build .gdb kernels to be included with the kernel sets.
+		Default: no
+
 MKDEPINCLUDES	If "yes" issue .include statements in the .depend file
 		instead of inlining the contents of the .d files. Useful
 		when stale dependencies are present, to list the exact

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1270 src/share/mk/bsd.own.mk:1.1271
--- src/share/mk/bsd.own.mk:1.1270	Sun Dec 12 15:33:22 2021
+++ src/share/mk/bsd.own.mk	Mon Dec 20 09:41:26 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1270 2021/12/12 20:33:22 maya Exp $
+#	$NetBSD: bsd.own.mk,v 1.1271 2021/12/20 14:41:26 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1292,7 +1292,7 @@ _MKVARS.no= \
 	MKARZERO \
 	MKBSDGREP \
 	MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \
-	MKDEBUG MKDEBUGLIB MKDTB MKDTRACE \
+	MKDEBUG MKDEBUGKERNEL MKDEBUGLIB MKDTB MKDTRACE \
 	MKEXTSRC \
 	MKFIRMWARE \
 	MKGROFFHTMLDOC \

Reply via email to