Thu Feb 17 18:47:13 2011 UTC ()
If generating a gdb kernel and using dbsym, insert the symbols into it.
(This is useful when using the .gdb with an emulator so that ddb in the
emulator will have symbols).


(matt)
diff -r1.129 -r1.130 src/sys/conf/Makefile.kern.inc

cvs diff -r1.129 -r1.130 src/sys/conf/Makefile.kern.inc (expand / switch to unified diff)

--- src/sys/conf/Makefile.kern.inc 2011/01/04 01:52:30 1.129
+++ src/sys/conf/Makefile.kern.inc 2011/02/17 18:47:13 1.130
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile.kern.inc,v 1.129 2011/01/04 01:52:30 matt Exp $ 1# $NetBSD: Makefile.kern.inc,v 1.130 2011/02/17 18:47:13 matt Exp $
2# 2#
3# This file contains common `MI' targets and definitions and it is included 3# This file contains common `MI' targets and definitions and it is included
4# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. 4# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
5# 5#
6# Each target in this file should be protected with `if !target(target)' 6# Each target in this file should be protected with `if !target(target)'
7# or `if !commands(target)' and each variable should only be conditionally 7# or `if !commands(target)' and each variable should only be conditionally
8# assigned `VAR ?= VALUE', so that everything can be overriden. 8# assigned `VAR ?= VALUE', so that everything can be overriden.
9# 9#
10# DEBUG is set to -g if debugging. 10# DEBUG is set to -g if debugging.
11# PROF is set to -pg if profiling. 11# PROF is set to -pg if profiling.
12# 12#
13# To specify debugging, add the config line: makeoptions DEBUG="-g" 13# To specify debugging, add the config line: makeoptions DEBUG="-g"
14# A better way is to specify -g only for a few files. 14# A better way is to specify -g only for a few files.
@@ -239,26 +239,32 @@ LINKFLAGS_DEBUG?= -X @@ -239,26 +239,32 @@ LINKFLAGS_DEBUG?= -X
239SYSTEM_LD_TAIL_DEBUG?=; \ 239SYSTEM_LD_TAIL_DEBUG?=; \
240 echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 240 echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
241 echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 241 echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
242 ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 242 ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
243LINKFLAGS_NORMAL?= -S 243LINKFLAGS_NORMAL?= -S
244STRIPFLAGS?= -g 244STRIPFLAGS?= -g
245 245
246DEBUG?= 246DEBUG?=
247.if !empty(DEBUG:M-g*) 247.if !empty(DEBUG:M-g*)
248SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG} 248SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
249LINKFLAGS+= ${LINKFLAGS_DEBUG} 249LINKFLAGS+= ${LINKFLAGS_DEBUG}
250EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@} 250EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
251CTFFLAGS+= -g 251CTFFLAGS+= -g
 252SYSTEM_LD_TAIL+=; \
 253 if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \
 254 echo "${DBSYM} $@.gdb"; \
 255 ${DBSYM} $@.gdb; \
 256 fi
 257
252.elifndef PROF 258.elifndef PROF
253LINKFLAGS+= ${LINKFLAGS_NORMAL} 259LINKFLAGS+= ${LINKFLAGS_NORMAL}
254.endif 260.endif
255 261
256SYSTEM_LD_TAIL+=; \ 262SYSTEM_LD_TAIL+=; \
257 if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \ 263 if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \
258 echo "${DBSYM} $@"; \ 264 echo "${DBSYM} $@"; \
259 ${DBSYM} $@; \ 265 ${DBSYM} $@; \
260 fi 266 fi
261 267
262SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA} 268SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA}
263SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_EXTRA} 269SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_EXTRA}
264 270