Add DEBUGLIST mechanism. Example config line:

makeoptions DEBUGLIST="uvm* trap ufs*"
This turns on -g for only those files matching a DEBUGLIST pattern word.
This commit is contained in:
ross 2001-05-08 05:47:35 +00:00
parent 580e36f497
commit d6a25f9b02
2 changed files with 22 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.184 2001/05/06 20:32:20 ad Exp $
# $NetBSD: GENERIC,v 1.185 2001/05/08 05:47:35 ross Exp $
#
# Generic Alpha kernel. Enough to get booted, etc., but not much more.
#
@ -6,7 +6,7 @@
include "arch/alpha/conf/std.alpha"
#ident "GENERIC-$Revision: 1.184 $"
#ident "GENERIC-$Revision: 1.185 $"
maxusers 32
@ -39,6 +39,7 @@ options NTP # kernel PLL for NTP
options DIAGNOSTIC # Cheap kernel consistency checks
options DDB # kernel debugger
#makeoptions DEBUG="-g"
#makeoptions DEBUGLIST="pattern1 pattern2 ..."
# File systems
file-system FFS # Fast file system

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.alpha,v 1.62 2000/12/17 15:52:39 jdolecek Exp $
# $NetBSD: Makefile.alpha,v 1.63 2001/05/08 05:47:35 ross Exp $
# Makefile for NetBSD
#
@ -14,6 +14,11 @@
# DEBUG is set to -g if debugging.
# PROF is set to -pg if profiling.
#
# To specify debugging, add the config line: makeoptions DEBUG="-g"
# A better way is to specify -g only for a few files.
#
# makeoptions DEBUGLIST="uvm* trap if_*"
AR?= ar
AS?= as
@ -46,7 +51,7 @@ CWARNFLAGS+= -Wno-uninitialized
.if (${HAVE_EGCS} != "")
CWARNFLAGS+= -Wno-main
.endif
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -mno-fp-regs
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -mno-fp-regs ${${<:T:R}_G}
AFLAGS= -traditional -D_LOCORE
LOADADDRESS?= fffffc0000300000
LINKFLAGS= -N -Ttext ${LOADADDRESS} -e __transfer -G 4
@ -83,6 +88,17 @@ NORMAL_S= ${CPP} ${AFLAGS} ${CPPFLAGS} $< | sed -e 's,^\#.*,,' | ${AS} -o ${.TAR
%SFILES
#
# Define a set of xxx_G variables that will add -g to just those
# files that match the shell patterns given in ${DEBUGLIST}
#
.for i in ${DEBUGLIST}
.for j in ${CFILES:T:M$i.c}
${j:R}_G= -g
.endfor
.endfor
# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
# ${SYSTEM_LD_HEAD}
@ -97,7 +113,7 @@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
DEBUG?=
.if ${DEBUG} == "-g"
.if ${DEBUG} == "-g" || defined(DEBUGLIST)
LINKFLAGS+= -X
SYSTEM_LD_TAIL+=; \
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \