Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/conf Add DEBUGLIST mechanism. Example config ...



details:   https://anonhg.NetBSD.org/src/rev/7c4474b07c34
branches:  trunk
changeset: 509587:7c4474b07c34
user:      ross <ross%NetBSD.org@localhost>
date:      Tue May 08 05:47:35 2001 +0000

description:
Add DEBUGLIST mechanism. Example config line:
        makeoptions DEBUGLIST="uvm* trap ufs*"
This turns on -g for only those files matching a DEBUGLIST pattern word.

diffstat:

 sys/arch/alpha/conf/GENERIC        |   5 +++--
 sys/arch/alpha/conf/Makefile.alpha |  22 +++++++++++++++++++---
 2 files changed, 22 insertions(+), 5 deletions(-)

diffs (83 lines):

diff -r d7a4e89f146b -r 7c4474b07c34 sys/arch/alpha/conf/GENERIC
--- a/sys/arch/alpha/conf/GENERIC       Tue May 08 05:36:01 2001 +0000
+++ b/sys/arch/alpha/conf/GENERIC       Tue May 08 05:47:35 2001 +0000
@@ -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        DIAGNOSTIC              # Cheap kernel consistency checks
 options        DDB                     # kernel debugger
 #makeoptions   DEBUG="-g"
+#makeoptions   DEBUGLIST="pattern1 pattern2 ..."
 
 # File systems
 file-system    FFS             # Fast file system
diff -r d7a4e89f146b -r 7c4474b07c34 sys/arch/alpha/conf/Makefile.alpha
--- a/sys/arch/alpha/conf/Makefile.alpha        Tue May 08 05:36:01 2001 +0000
+++ b/sys/arch/alpha/conf/Makefile.alpha        Tue May 08 05:47:35 2001 +0000
@@ -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 @@
 .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 @@
 
 %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_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; \



Home | Main Index | Thread Index | Old Index