From d820f3e3ba1e6e29ce2bf7dcd9ec368578f3f3d7 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 9 Aug 2009 23:04:50 +0000 Subject: Introduce option DDB_STRUCT. Kernels compiled with this option (except on a few arches where toolchain limitations apply) will embed some symbolic information about the various structs used within the kernel, and have new ddb commands allowing struct display and some useful information gathering. Kernel rodata increase varies accross platforms from ~150KB to ~300KB. This option is not enabled by default. --- sys/arch/armish/conf/Makefile.armish | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'sys/arch/armish') diff --git a/sys/arch/armish/conf/Makefile.armish b/sys/arch/armish/conf/Makefile.armish index b9782cffd15..dd6eedb0f6c 100644 --- a/sys/arch/armish/conf/Makefile.armish +++ b/sys/arch/armish/conf/Makefile.armish @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.armish,v 1.10 2009/01/11 21:02:03 pirofti Exp $ +# $OpenBSD: Makefile.armish,v 1.11 2009/08/09 23:04:49 miod Exp $ # $NetBSD: Makefile.i386,v 1.67 1996/05/11 16:12:11 mycroft Exp $ # Makefile for OpenBSD @@ -57,6 +57,12 @@ LINKFLAGS= -T ldscript LINKFLAGS+= --warn-common STRIPFLAGS= -g -X -x +.if ${IDENT:M-DDDB_STRUCT} +DB_STRUCTINFO= db_structinfo.h +.else +DB_STRUCTINFO= +.endif + HOSTCC= ${CC} HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} @@ -143,7 +149,7 @@ newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} clean:: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \ - [Ee]rrs linterrs makelinks assym.h + [Ee]rrs linterrs makelinks assym.h ${DB_STRUCTINFO} lint: @lint -hbxncez -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \ @@ -164,7 +170,7 @@ links: SRCS= ${ARM}/arm/locore.S \ param.c ioconf.c ${CFILES} ${SFILES} depend:: .depend -.depend: ${SRCS} assym.h param.c ${APMINC} +.depend: ${SRCS} assym.h param.c ${APMINC} ${DB_STRUCTINFO} ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${ARM}/arm/locore.S ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} .if ${SFILES} != "" @@ -177,6 +183,11 @@ depend:: .depend < assym.dep >> .depend @rm -f assym.dep +db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk + ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ + rm -f db_structinfo.o + # depend on root or device configuration autoconf.o conf.o: Makefile -- cgit v1.2.3