summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-09-12 08:23:43 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-09-12 08:23:43 +0000
commitd85b54c8c0320dc689337e05db0e93e578228b46 (patch)
treeb54bececd535f7428c1de108819e6f9c1b847f91
parent6a451158c1ca085d46c0e56db8e257e33459f242 (diff)
Remove option DDB_STRUCTINFO. Now that ddb(4) is CTF aware, similar
functionnalities are available in GENERIC. ok jasper@, deraadt@, guenther@, dlg@
-rw-r--r--sys/arch/alpha/conf/Makefile.alpha29
-rw-r--r--sys/arch/amd64/conf/Makefile.amd6429
-rw-r--r--sys/arch/arm64/conf/Makefile.arm6430
-rw-r--r--sys/arch/armv7/conf/Makefile.armv730
-rw-r--r--sys/arch/hppa/conf/Makefile.hppa29
-rw-r--r--sys/arch/i386/conf/Makefile.i38629
-rw-r--r--sys/arch/landisk/conf/Makefile.landisk29
-rw-r--r--sys/arch/loongson/conf/Makefile.loongson29
-rw-r--r--sys/arch/luna88k/conf/Makefile.luna88k29
-rw-r--r--sys/arch/macppc/conf/Makefile.macppc29
-rw-r--r--sys/arch/octeon/conf/Makefile.octeon29
-rw-r--r--sys/arch/sgi/conf/Makefile.sgi29
-rw-r--r--sys/arch/socppc/conf/Makefile.socppc29
-rw-r--r--sys/arch/sparc64/conf/Makefile.sparc6429
-rw-r--r--sys/conf/files3
-rw-r--r--sys/ddb/db_command.c5
-rw-r--r--sys/ddb/db_struct.c277
-rw-r--r--sys/ddb/db_structinfo.c106
-rwxr-xr-xsys/ddb/parse_structinfo.pl390
19 files changed, 30 insertions, 1159 deletions
diff --git a/sys/arch/alpha/conf/Makefile.alpha b/sys/arch/alpha/conf/Makefile.alpha
index 6b2f0c1d366..0079f644938 100644
--- a/sys/arch/alpha/conf/Makefile.alpha
+++ b/sys/arch/alpha/conf/Makefile.alpha
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.alpha,v 1.107 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.alpha,v 1.108 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -45,12 +45,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -T ld.script -X -N -G 4 --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -134,7 +128,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -142,11 +136,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o: ${_machdir}/${_mach}/locore.s assym.h
@@ -157,18 +146,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64
index 22f4aa5db98..d6cd443759f 100644
--- a/sys/arch/amd64/conf/Makefile.amd64
+++ b/sys/arch/amd64/conf/Makefile.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.amd64,v 1.92 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.amd64,v 1.93 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -51,12 +51,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -T ld.script -X --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -140,7 +134,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -148,11 +142,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o mutex.o vector.o copy.o spl.o: assym.h
mptramp.o acpi_wakecode.o vmm_support.o: assym.h
@@ -164,18 +153,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/arm64/conf/Makefile.arm64 b/sys/arch/arm64/conf/Makefile.arm64
index 878f736f093..3e5e9d19739 100644
--- a/sys/arch/arm64/conf/Makefile.arm64
+++ b/sys/arch/arm64/conf/Makefile.arm64
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.arm64,v 1.21 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.arm64,v 1.22 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -46,12 +46,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -T ld.script -X --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -140,7 +134,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -148,11 +142,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_archdir}/${_arch}/locore0.S assym.h
in_cksum_arm.o fiq_subr.o bcopyinout.o copystr.o sigcode.o copy.o: assym.h
vectors.o cpuswitch.o exception.o bcopy_page.o irq_dispatch.o support.o: assym.h
@@ -165,21 +154,6 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
-
## for qemu this is where ram is located
RAM_ADDR?=0x40000000
#KERNEL_LOAD_ADDR!=echo "x = hex(${KERNEL_BASE_PHYS} + ${RAM_ADDR}); print x" | python
diff --git a/sys/arch/armv7/conf/Makefile.armv7 b/sys/arch/armv7/conf/Makefile.armv7
index 1d63b7e3842..ed0a33aee09 100644
--- a/sys/arch/armv7/conf/Makefile.armv7
+++ b/sys/arch/armv7/conf/Makefile.armv7
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.armv7,v 1.34 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.armv7,v 1.35 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -43,12 +43,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -T ld.script --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -139,7 +133,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -147,11 +141,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
in_cksum_arm.o fiq_subr.o bcopyinout.o copystr.o sigcode.o: assym.h
vectors.o cpuswitch7.o exception.o bcopy_page.o irq_dispatch.o: assym.h
@@ -164,21 +153,6 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
-
# until we get native booting working, put this in the tree.
KERNADDR_OMAP=0x80300000
KERNADDR_IMX=0x10300000
diff --git a/sys/arch/hppa/conf/Makefile.hppa b/sys/arch/hppa/conf/Makefile.hppa
index 162930c9b4c..320ecc868f0 100644
--- a/sys/arch/hppa/conf/Makefile.hppa
+++ b/sys/arch/hppa/conf/Makefile.hppa
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.hppa,v 1.101 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.hppa,v 1.102 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -53,12 +53,6 @@ CFLAGS+= -mpa-risc-2-0
CFLAGS+= -mpa-risc-1-1
.endif
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -142,7 +136,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -150,11 +144,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o: ${_machdir}/${_mach}/locore.S assym.h
fpemu.o spcopy.o: assym.h
@@ -166,18 +155,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386
index 1449daacff3..adc890e3a9c 100644
--- a/sys/arch/i386/conf/Makefile.i386
+++ b/sys/arch/i386/conf/Makefile.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.i386,v 1.117 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.i386,v 1.118 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -53,12 +53,6 @@ AFLAGS+= -m32
LINKFLAGS+= -melf_i386_obsd
.endif
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -142,7 +136,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -150,11 +144,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o mutex.o in_cksum.o mptramp.o: assym.h
kvm86call.o acpi_wakecode.o vmm_support.o: assym.h
@@ -166,18 +155,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/landisk/conf/Makefile.landisk b/sys/arch/landisk/conf/Makefile.landisk
index 158eac92884..e15940181dc 100644
--- a/sys/arch/landisk/conf/Makefile.landisk
+++ b/sys/arch/landisk/conf/Makefile.landisk
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.landisk,v 1.73 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.landisk,v 1.74 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -45,12 +45,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -N -Ttext 0x8c002000 -e start --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -134,7 +128,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -142,11 +136,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore.o: ${_machdir}/${_mach}/locore.S assym.h
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore_subr.o vectors.o in_cksum.o: assym.h
@@ -158,18 +147,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/loongson/conf/Makefile.loongson b/sys/arch/loongson/conf/Makefile.loongson
index 5816e3d68bc..9baef0290b5 100644
--- a/sys/arch/loongson/conf/Makefile.loongson
+++ b/sys/arch/loongson/conf/Makefile.loongson
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.loongson,v 1.66 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.loongson,v 1.67 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -50,12 +50,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -e start -T ld.script -Ttext=${LINK_ADDRESS} -warn-common -nopie
-.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 +137,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -155,11 +149,6 @@ symbols.sort: ${_machdir}/${_mach}/symbols.raw
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
context.o cp0access.o exception.o locore.o: assym.h
lcore_access.o lcore_ddb.o lcore_float.o tlbhandler.o: assym.h
@@ -172,18 +161,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/luna88k/conf/Makefile.luna88k b/sys/arch/luna88k/conf/Makefile.luna88k
index 605191bd72c..16c3c362ad2 100644
--- a/sys/arch/luna88k/conf/Makefile.luna88k
+++ b/sys/arch/luna88k/conf/Makefile.luna88k
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.luna88k,v 1.76 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.luna88k,v 1.77 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -45,12 +45,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -T ld.script -Ttext 0x80000 -e __start -X -N --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -138,7 +132,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -146,11 +140,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o eh.o mutex.o process.o subr.o: assym.h
@@ -161,18 +150,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/macppc/conf/Makefile.macppc b/sys/arch/macppc/conf/Makefile.macppc
index 32a9da4046c..8ba6a41e8f6 100644
--- a/sys/arch/macppc/conf/Makefile.macppc
+++ b/sys/arch/macppc/conf/Makefile.macppc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.macppc,v 1.90 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.macppc,v 1.91 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -45,12 +45,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE ${CMACHFLAGS}
LINKFLAGS= -N -Ttext 100114 -e start --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -134,7 +128,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -142,11 +136,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o: ${_machdir}/${_mach}/locore.S assym.h
mutex.o: assym.h
@@ -158,18 +147,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/octeon/conf/Makefile.octeon b/sys/arch/octeon/conf/Makefile.octeon
index 3af77c5a673..875e7111aee 100644
--- a/sys/arch/octeon/conf/Makefile.octeon
+++ b/sys/arch/octeon/conf/Makefile.octeon
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.octeon,v 1.45 2017/08/19 12:52:32 visa Exp $
+# $OpenBSD: Makefile.octeon,v 1.46 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -50,12 +50,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -e start -T ld.script -Ttext=${LINK_ADDRESS} --warn-common -nopie
-.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 +137,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -155,11 +149,6 @@ symbols.sort: ${_machdir}/${_mach}/symbols.raw
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
context.o cp0access.o exception.o locore.o: assym.h
lcore_access.o lcore_ddb.o lcore_float.o tlbhandler.o: assym.h
@@ -172,18 +161,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/sgi/conf/Makefile.sgi b/sys/arch/sgi/conf/Makefile.sgi
index b510a543a55..fb462dc609d 100644
--- a/sys/arch/sgi/conf/Makefile.sgi
+++ b/sys/arch/sgi/conf/Makefile.sgi
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.sgi,v 1.90 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.sgi,v 1.91 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -50,12 +50,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -e start -T ld.script -Ttext=${LINK_ADDRESS} --warn-common -nopie
-.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 +137,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -155,11 +149,6 @@ symbols.sort: ${_machdir}/${_mach}/symbols.raw
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
context.o cp0access.o exception.o exception_tfp.o: assym.h
lcore_access.o lcore_ddb.o lcore_float.o locore.o: assym.h
@@ -173,18 +162,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/socppc/conf/Makefile.socppc b/sys/arch/socppc/conf/Makefile.socppc
index cb1bfa93f7d..9e71a2a91c3 100644
--- a/sys/arch/socppc/conf/Makefile.socppc
+++ b/sys/arch/socppc/conf/Makefile.socppc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.socppc,v 1.56 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.socppc,v 1.57 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -41,12 +41,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE ${CMACHFLAGS}
LINKFLAGS= -N -Ttext 200000 -e start --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -118,18 +112,13 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} param.c
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore.o: ${_machdir}/${_mach}/locore.S assym.h
mutex.o: assym.h
@@ -144,18 +133,4 @@ install-kernel-${MACHINE_NAME}:
mv /nbsd /bsd
.endif
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/arch/sparc64/conf/Makefile.sparc64 b/sys/arch/sparc64/conf/Makefile.sparc64
index fddcc78003a..f889bbc42b3 100644
--- a/sys/arch/sparc64/conf/Makefile.sparc64
+++ b/sys/arch/sparc64/conf/Makefile.sparc64
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.sparc64,v 1.93 2017/08/12 20:26:11 mpi Exp $
+# $OpenBSD: Makefile.sparc64,v 1.94 2017/09/12 08:23:42 mpi Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -43,12 +43,6 @@ CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS}
LINKFLAGS= -n -T ld.script --warn-common -nopie
-.if ${IDENT:M-DDDB_STRUCT}
-DB_STRUCTINFO= db_structinfo.h
-.else
-DB_STRUCTINFO=
-.endif
-
HOSTCC?= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
@@ -132,7 +126,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
cleandir: clean
@@ -140,11 +134,6 @@ cleandir: clean
depend obj:
-db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
- ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c
- objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@
- rm -f db_structinfo.o
-
locore.o: ${_machdir}/${_mach}/locore.s assym.h
hvcall.o in_cksum.o mutex.o: assym.h
@@ -155,18 +144,4 @@ newinstall:
install: update-link newinstall
-# pull in the dependency information
-.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
- ${SYSTEM_OBJ}: ${DB_STRUCTINFO}
-.endif
-.ifnmake clean
-. for o in ${SYSTEM_OBJ:Ngap.o} assym.h ${DB_STRUCTINFO}
-. if exists(${o:R}.d)
-. include "${o:R}.d"
-. elif exists($o)
- .PHONY: $o
-. endif
-. endfor
-.endif
-
%RULES
diff --git a/sys/conf/files b/sys/conf/files
index 8aafd6cc06c..db3fc01fa00 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.651 2017/08/11 20:50:15 mpi Exp $
+# $OpenBSD: files,v 1.652 2017/09/12 08:23:42 mpi Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -609,7 +609,6 @@ file ddb/db_lex.c ddb
file ddb/db_output.c ddb
file ddb/db_prof.c ddb & ddbprof & !gprof
file ddb/db_run.c ddb
-file ddb/db_struct.c ddb & ddb_struct
file ddb/db_sym.c ddb
file ddb/db_trap.c ddb
file ddb/db_variables.c ddb
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 2242dce5e6c..0cf09c4c878 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.c,v 1.76 2017/09/06 04:47:26 dlg Exp $ */
+/* $OpenBSD: db_command.c,v 1.77 2017/09/12 08:23:42 mpi Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
@@ -581,9 +581,6 @@ struct db_command db_show_cmds[] = {
{ "nfsnode", db_nfsnode_print_cmd, 0, NULL },
#endif
{ "object", db_object_print_cmd, 0, NULL },
-#ifdef DDB_STRUCT
- { "offset", db_struct_offset_cmd, CS_OWN, NULL },
-#endif
{ "page", db_page_print_cmd, 0, NULL },
{ "panic", db_show_panic_cmd, 0, NULL },
{ "pool", db_pool_print_cmd, 0, NULL },
diff --git a/sys/ddb/db_struct.c b/sys/ddb/db_struct.c
deleted file mode 100644
index 32ac575030d..00000000000
--- a/sys/ddb/db_struct.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* $OpenBSD: db_struct.c,v 1.4 2015/09/01 05:26:10 jsg Exp $ */
-
-/*
- * Copyright (c) 2009 Miodrag Vallat.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * ddb routines to describe struct information
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <machine/db_machdep.h>
-
-#include <ddb/db_lex.h>
-#include <ddb/db_output.h>
-#include <ddb/db_access.h>
-#include <ddb/db_command.h>
-#include <ddb/db_extern.h>
-#include <ddb/db_interface.h>
-#include <ddb/db_var.h>
-
-#include "db_structinfo.h"
-
-void db_struct_print_field(uint, int, db_expr_t);
-
-/*
- * Flags to pass db_struct_printf().
- */
-
-#define DBSP_STRUCT_NAME 0x01 /* prepend struct name */
-#define DBSP_VALUE 0x02 /* display field value */
-
-void
-db_struct_print_field(uint fidx, int flags, db_expr_t baseaddr)
-{
- const struct ddb_field_info *field;
- const struct ddb_struct_info *struc;
- db_expr_t value;
- uint tmp;
- size_t namelen;
- int width, basecol, curcol;
- char tmpfmt[28];
-
- field = &ddb_field_info[fidx];
- basecol = 0;
-
- if (ISSET(flags, DBSP_STRUCT_NAME)) {
- struc = &ddb_struct_info[field->sidx];
- namelen = strlen(ddb_structfield_strings + struc->name);
- db_printf("%-30s ", ddb_structfield_strings + struc->name);
- if (namelen > 30)
- basecol += namelen + 1;
- else
- basecol += 30 + 1;
- }
-
- namelen = strlen(ddb_structfield_strings + field->name);
- if (field->nitems == 1) {
- db_printf("%-30s ", ddb_structfield_strings + field->name);
- if (namelen > 30)
- basecol += namelen + 1;
- else
- basecol += 30 + 1;
- } else {
- width = 30 - 2;
- tmp = field->nitems;
- while (tmp != 0) {
- width--;
- tmp /= 10;
- }
- if (namelen >= width) {
- db_printf("%s[%hu] ",
- ddb_structfield_strings + field->name,
- field->nitems);
- basecol += namelen + (30 - width) + 1;
- } else {
- db_printf("%s[%hu]%*s ",
- ddb_structfield_strings + field->name,
- field->nitems, width - (int)namelen, "");
- /* namelen + (30-width) + (width-namelen) + 1 */
- basecol += 30 + 1;
- }
- }
-
- if (field->size == 0) {
- db_printf("bitfield");
- /* basecol irrelevant from there on */
- } else {
- snprintf(tmpfmt, sizeof tmpfmt, "%u", (u_int)field->size);
- basecol += strlen(tmpfmt) + 1;
- db_printf("%s ", tmpfmt);
- }
-
- if (ISSET(flags, DBSP_VALUE)) {
- /* only print the field value if it has a friendly size. */
- switch (field->size) {
- case 1:
- width = 4;
- break;
- case 2:
- width = 8;
- break;
- case 4:
- width = 12;
- break;
-#ifdef __LP64__
- case 8:
- width = 20;
- break;
-#endif
- default:
- width = 0;
- }
- if (width != 0) {
- baseaddr += field->offs;
- curcol = basecol;
- for (tmp = field->nitems; tmp != 0; tmp--) {
- value = db_get_value(baseaddr, field->size,
- FALSE); /* assume unsigned */
- db_format(tmpfmt, sizeof tmpfmt, (long)value,
- DB_FORMAT_N, 0, width);
- if (field->nitems > 1)
- db_printf("%s", tmpfmt);
- else
- db_printf("%20s", tmpfmt);
- baseaddr += field->size;
-
- /*
- * Try to fit array elements on as few lines
- * as possible.
- */
- if (field->nitems > 1 && tmp > 1) {
- curcol += width + 1;
- if (basecol >= db_max_width ||
- curcol + width >= db_max_width) {
- /* new line */
- db_printf("\n");
- if (basecol + width >=
- db_max_width) {
- db_printf("\t");
- curcol = 8;
- } else {
- db_printf("%*s",
- basecol, "");
- curcol = basecol;
- }
- } else
- db_printf(" ");
- }
- }
- }
- }
-
- db_printf("\n");
-}
-
-
-/*
- * show offset <value>: displays the list of struct fields which exist
- * at that particular offset from the beginning of the struct.
- */
-void
-db_struct_offset_cmd(db_expr_t addr, int have_addr, db_expr_t count,
- char *modifiers)
-{
- db_expr_t offset = 0;
- const struct ddb_field_offsets *field;
- const ddb_field_off *fidx;
- uint oidx;
- int width;
- char tmpfmt[28];
-
- /*
- * Read the offset from the debuggger input.
- * We don't want to get it from the standard parsing code, because
- * this would set `dot' to this value, which doesn't make sense.
- */
-
- if (!db_expression(&offset) || offset < 0) {
- db_printf("not a valid offset\n");
- db_flush_lex();
- return;
- }
-
- db_skip_to_eol();
-
- for (field = ddb_field_offsets, oidx = 0; oidx < NOFFS; field++, oidx++)
- if (field->offs == (size_t)offset)
- break;
-
- if (oidx == NOFFS) {
- width = 0;
- db_format(tmpfmt, sizeof tmpfmt, (long)offset,
- DB_FORMAT_N, 0, width);
- db_printf("no known structure element at offset %-*s\n",
- width, tmpfmt);
- db_flush_lex();
- return;
- }
-
- db_printf("%-30s %-30s size\n", "struct", "member");
- for (fidx = ddb_fields_by_offset + field->list; *fidx != 0; fidx++)
- db_struct_print_field(*fidx, DBSP_STRUCT_NAME, 0);
-}
-
-/*
- * show struct <struct name> [addr]: displays the data starting at addr
- * (`dot' if unspecified) as a struct of the given type.
- */
-void
-db_struct_layout_cmd(db_expr_t addr, int have_addr, db_expr_t count,
- char *modifiers)
-{
- const struct ddb_struct_info *struc;
- uint sidx, fidx;
- int t;
-
- /*
- * Read the struct name from the debugger input.
- */
-
- t = db_read_token();
- if (t != tIDENT) {
- db_printf("Bad struct name\n");
- db_flush_lex();
- return;
- }
-
- for (struc = ddb_struct_info, sidx = 0; sidx < NSTRUCT;
- struc++, sidx++)
- if (strcmp(ddb_structfield_strings + struc->name,
- db_tok_string) == 0)
- break;
-
- if (sidx == NSTRUCT) {
- db_printf("unknown struct %s\n", db_tok_string);
- db_flush_lex();
- return;
- }
-
- /*
- * Read the address, if any, from the debugger input.
- * In that case, update `dot' value.
- */
-
- if (db_expression(&addr)) {
- db_dot = (db_addr_t)addr;
- db_last_addr = db_dot;
- } else
- addr = (db_expr_t)db_dot;
-
- db_skip_to_eol();
-
- /*
- * Display the structure contents.
- */
-
- db_printf("struct %s at %p (%u bytes)\n",
- ddb_structfield_strings + struc->name, (void *)addr,
- (u_int)struc->size);
- for (fidx = struc->fmin; fidx <= struc->fmax; fidx++)
- db_struct_print_field(fidx, DBSP_VALUE, addr);
-}
diff --git a/sys/ddb/db_structinfo.c b/sys/ddb/db_structinfo.c
deleted file mode 100644
index 611e1636843..00000000000
--- a/sys/ddb/db_structinfo.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* $OpenBSD: db_structinfo.c,v 1.16 2017/07/29 08:50:42 zhuk Exp $ */
-/* public domain */
-/*
- * This file is intended to be compiled with debug information,
- * which is then translated by parse_debug.awk into support data
- * for ddb.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/acct.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/disk.h>
-#include <sys/disklabel.h>
-#include <sys/dirent.h>
-#include <sys/evcount.h>
-#include <sys/event.h>
-#include <sys/eventvar.h>
-#include <sys/exec.h>
-#include <sys/extent.h>
-#include <sys/fcntl.h>
-#include <sys/file.h>
-#include <sys/filedesc.h>
-#include <sys/gpio.h>
-#include <sys/hotplug.h>
-#include <sys/ipc.h>
-#include <sys/kcore.h>
-#include <sys/kthread.h>
-#include <sys/ktrace.h>
-#include <sys/lock.h>
-#include <sys/lockf.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/memrange.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/msg.h>
-#include <sys/msgbuf.h>
-#include <sys/namei.h>
-#include <sys/pipe.h>
-#include <sys/pool.h>
-#include <sys/protosw.h>
-#include <sys/ptrace.h>
-#include <sys/queue.h>
-#include <sys/resource.h>
-#include <sys/resourcevar.h>
-#include <sys/rwlock.h>
-#include <sys/sched.h>
-#include <sys/select.h>
-#include <sys/selinfo.h>
-#include <sys/sem.h>
-#include <sys/sensors.h>
-#include <sys/shm.h>
-#include <sys/siginfo.h>
-#include <sys/signal.h>
-#include <sys/signalvar.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/stat.h>
-#include <sys/statvfs.h>
-#include <sys/swap.h>
-#include <sys/syscall.h>
-#include <sys/syscallargs.h>
-#include <sys/sysctl.h>
-#include <sys/syslog.h>
-#include <sys/termios.h>
-#include <sys/time.h>
-#include <sys/timeout.h>
-#include <sys/timetc.h>
-#include <sys/tprintf.h>
-#include <sys/tree.h>
-#include <sys/tty.h>
-#include <sys/ucred.h>
-#include <sys/uio.h>
-#include <sys/un.h>
-#include <sys/unpcb.h>
-#include <sys/utsname.h>
-#include <sys/vmmeter.h>
-#include <sys/vnode.h>
-#include <sys/wait.h>
-
-#include <machine/cpu.h>
-#include <machine/conf.h>
-#include <machine/mutex.h>
-
-#include <uvm/uvm.h>
-
-/* XXX add filesystem includes there */
-
-#include <sys/ataio.h>
-#include <sys/audioio.h>
-#include <sys/cdio.h>
-#include <sys/chio.h>
-#include <sys/dkio.h>
-#include <sys/filio.h>
-#include <sys/mtio.h>
-#include <sys/pciio.h>
-#include <sys/radioio.h>
-#include <sys/scsiio.h>
-#include <sys/sockio.h>
-#include <sys/videoio.h>
diff --git a/sys/ddb/parse_structinfo.pl b/sys/ddb/parse_structinfo.pl
deleted file mode 100755
index 8bee04ed584..00000000000
--- a/sys/ddb/parse_structinfo.pl
+++ /dev/null
@@ -1,390 +0,0 @@
-#!/usr/bin/perl
-# $OpenBSD: parse_structinfo.pl,v 1.3 2015/04/29 06:06:38 guenther Exp $
-#
-# Copyright (c) 2009 Miodrag Vallat.
-# Copyright (c) 2013 Philip Guenther.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-
-# This ugly script parses the output of objdump -g in order to extract
-# structure layout information, to be used by ddb.
-#
-# The output of this script is the following static data:
-# - for each struct:
-# - its name
-# - its size (individual element size if an array)
-# - the number of elements in the array (1 if not)
-# - its first and last field indexes
-# - for each field:
-# - its name
-# - its offset and size
-# - the index of the struct it is member of
-# This allows fast struct -> field information retrieval.
-#
-# To retrieve information from a field size or offset, we also output
-# the following reverse arrays:
-# - for each offset, in ascending order, a variable length list of field
-# indexes.
-# - for each size, in ascending order, a variable length list of field
-# indexes.
-#
-# The compromise here is that I want to minimize linear searches. Memory
-# use is considered secondary, hence the back `pointer' to the struct in the
-# fields array.
-
-use strict;
-use warnings;
-use integer;
-use IO::File;
-
-use constant MAX_COLUMN => 72;
-
-my $depth = 0;
-my $ignore = 0;
-
-my $cur_struct;
-
-my $max_offs = 0;
-my $max_fsize = 0;
-my $max_ssize = 0;
-
-# Variables used in generating the raw, textual output
-my $txt; # IO::File to write to
-my @id2struct; # mapping of objdump's struct ids to @structs idxes
-my @subfield; # list of subfields to dump at the end
-
-# count of how many times each literal string appears
-my %strings;
-my @strings_by_len;
-sub add_string
-{
- my $string = shift;
- if ($strings{$string}++ == 0) {
- push @{ $strings_by_len[ length $string ] }, $string;
- }
-}
-
-my @structs;
-
-my %offs_to_fields;
-my %size_to_fields;
-my @fields = ( {
- name => "",
- offs => 0,
- size => 0,
- items => 0,
- struct => 0,
- } );
-sub new_field
-{
- my($name, $offs, $size, $items, $id) = @_;
-
- $items //= 1;
- add_string($name);
- push @fields, {
- name => $name,
- offs => $offs,
- size => $size,
- items => $items,
- struct => scalar(@structs),
- };
- $max_offs = $offs if $offs > $max_offs;
- $max_fsize = $size if $size > $max_fsize;
- push @{ $offs_to_fields{$offs} }, $#fields;
- push @{ $size_to_fields{$size} }, $#fields;
- if ($txt) {
- raw($offs, $size * $items, $cur_struct->{name}, $name);
- if (defined $id) {
- push @subfield, [ $cur_struct->{name}, $name, $offs, $id ];
- }
- }
-}
-
-# Generate textual output for those who are ddb challenged.
-$txt = IO::File->new("db_structinfo.txt", "w")
- or warn "$0: unable to create db_structinfo.txt: $!";
-sub raw {
- my($offs, $size, $struct, $member) = @_;
- $txt->print(join("\t", $offs, $size, $offs+$size, $struct, $member), "\n");
-}
-$txt and $txt->print(join("\t", qw(offset size next struct member)), "\n");
-
-
-while (<>) {
- chomp; # strip record separator
- if (m!^struct (\w+) \{ /\* size (\d+) id (\d+) !) {
- $depth = 1;
- $cur_struct = {
- name => $1,
- size => $2,
- fieldmin => scalar(@fields)
- };
- $id2struct[$3] = scalar(@structs);
- next
- }
-
- if (/^};/) {
- if ($depth == 0) {
- $ignore--;
- next
- }
- $depth = 0;
- if (scalar(@fields) == $cur_struct->{fieldmin}) {
- # empty struct, ignore it
- undef $cur_struct;
- next
- }
- $cur_struct->{fieldmax} = $#fields;
- add_string( $cur_struct->{name} );
- $max_ssize = $cur_struct->{size} if $cur_struct->{size} > $max_ssize;
- push @structs, $cur_struct;
- next
- }
-
- next if /\{.*\}/; # single line enum
-
- if (/\{/) {
- # subcomponent
- if ($depth) {
- $depth++;
- } else {
- $ignore++;
- }
- next
- }
-
- if (/\}/) {
- if ($ignore) {
- $ignore--;
- next
- }
- $depth--;
- next if $depth != 1;
- # FALL THROUGH
- }
-
- if (/bitsize (\d+), bitpos (\d+)/) {
- next if $ignore;
- next if $depth != 1;
-
- # Bitfields are a PITA... From a ddb point of view, we can't really
- # access storage units smaller than a byte.
- # So we'll report all bitfields as having size 0, and the
- # rounded down byte position where they start.
- my $cursize = ($1 % 8) ? 0 : ($1 / 8);
- my $curoffs = $2 / 8;
-
- # Try and gather the field name.
- # The most common case: not a function pointer or array
- if (m!\s(\**)(\w+);\s/\* bitsize!) {
- my $pointer = $1 ne "";
- my $name = $2;
- # check for a struct id to match up
- my($id) = !$pointer && m!/\* id (\d+) \*/.*;!;
- new_field($name, $curoffs, $cursize, 1, $id);
- next
- }
-
- # How about a function pointer?
- if (m!\s\**\(\*+(\w+)\) \(/\* unknown \*/\);\s/\* bitsize!) {
- new_field($1, $curoffs, $cursize);
- next
- }
-
- # Maybe it's an array
- if (m!\s(\**)([][:\w]+);\s/\* bitsize!) {
- my $pointer = $1 ne "";
- my $name = $2;
- my $items = 1;
- while ($name =~ s/\[(\d+)\]:\w+//) {
- $items *= $1;
- }
- # check for a struct id to match up
- my($id) = !$pointer && m!/\* id (\d+) \*/.*;!;
- new_field($name, $curoffs, $cursize / $items, $items, $id);
- next
- }
-
- # skip any anonymous unions {
- next if m!\}; /\*!;
-
- # Should be nothing left
- print STDERR "unknown member type: $_\n";
- next
- }
-}
-
-# Do all the subfield processing
-# XXX Should recurse into subsub...fields?
-foreach my $sf (@subfield) {
- my($struct_name, $name, $offs, $id) = @$sf;
- my $s = $id2struct[$id];
-
- # We don't remember unions. No point in doing so
- next if !defined $s;
-
- my $struct = $structs[$s];
- foreach my $i ($struct->{fieldmin} .. $struct->{fieldmax}) {
- my $f = $fields[$i];
- raw($offs + $f->{offs}, $f->{size} * $f->{items},
- $struct_name, "$name.$f->{name}");
- }
-}
-
-# Pick a type for ddb_field_off: if the offsets and sizes are all less than
-# 65536 then we'll use u_short, otherwise u_int.
-my $f_type = "u_short";
-if ($max_offs > 65535 || $max_fsize > 65535 || $max_ssize > 65535) {
- $f_type = "u_int";
- print STDERR "Using u_int for struct/field sizes and offsets\n";
-}
-
-
-print <<EOM;
-/*
- * THIS IS A GENERATED FILE. DO NOT EDIT!
- */
-
-#include <sys/param.h>
-#include <sys/types.h>
-
-typedef $f_type ddb_field_off;
-
-struct ddb_struct_info {
- u_short name;
- ddb_field_off size;
- u_short fmin, fmax;
-};
-struct ddb_field_info {
- u_short name;
- u_short sidx;
- ddb_field_off offs;
- ddb_field_off size;
- u_short nitems;
-};
-struct ddb_field_offsets {
- ddb_field_off offs;
- u_short list;
-};
-struct ddb_field_sizes {
- ddb_field_off size;
- u_short list;
-};
-EOM
-
-my $prefix = qq(static const char ddb_structfield_strings[] =\n\t"\\0);
-my %string_to_offset = ( "" => 0 );
-my $soff = 1;
-for (my $len = $#strings_by_len; $len > 0; $len--) {
- foreach my $string (@{ $strings_by_len[$len] }) {
- next if exists $string_to_offset{$string};
- my $off = $string_to_offset{$string} = $soff;
- $soff += $len + 1; # for the NUL
- print $prefix, $string;
- $prefix = qq(\\0"\n\t");
-
- # check for suffixes that are also strings
- for (my $o = 1; $o < $len; $o++) {
- my $sstr = substr($string, $o);
- next unless exists $strings{$sstr};
- next if exists $string_to_offset{$sstr};
- $string_to_offset{$sstr} = $off + $o;
- #print STDERR "found $sstr inside $string\n";
- }
- }
-}
-print qq(";\n);
-
-sub resolve_string
-{
- my $string = shift;
- if (! exists $string_to_offset{$string}) {
- die "no mapping for $string";
- }
- return $string_to_offset{$string};
-}
-
-# Check for overflow and, if so, print some stats
-if ($soff > 65535 || @structs > 65535 || @fields > 65535) {
- print STDERR <<EOM;
-ERROR: value out of range of u_short Time to change types?
-
-max string offset: $soff
-max field offset: $max_offs
-max field size: $max_fsize
-max struct size: $max_ssize
-number of structs: ${\scalar(@structs)}
-number of fields: ${\scalar(@fields)}
-EOM
- exit 1
-}
-
-
-print "#define NSTRUCT ", scalar(@structs), "\n";
-print "static const struct ddb_struct_info ddb_struct_info[NSTRUCT] = {\n";
-
-foreach my $s (@structs) {
- my $name = resolve_string($s->{name});
- print "\t{ ",
- join(", ", $name, @{$s}{qw( size fieldmin fieldmax )}),
- " },\n";
-}
-printf "};\n\n";
-
-print "#define NFIELD ", scalar(@fields), "\n";
-print "static const struct ddb_field_info ddb_field_info[NFIELD] = {\n";
-foreach my $f (@fields) {
- my $name = resolve_string($f->{name});
- print "\t{ ",
- join(", ", $name, @{$f}{qw( struct offs size items )}),
- " },\n";
-}
-printf "};\n\n";
-
-
-# Given a mapping from values to fields that have that value, generate
-# two C arrays: one containing lists of fields with each value, in order;
-# the other indexing into that one for each value. I.e., to get the
-# fields that have a given value, find the value in the second array and
-# then iterate from where that points into the first array until you hit
-# an entry with field==0.
-sub print_reverse_mapping
-{
- my($prefix, $map, $max) = @_;
- print "static const ddb_field_off ddb_fields_by_${prefix}[] = {";
- my @heads;
- my $w = 0;
- foreach my $val (sort { $a <=> $b } keys %$map) {
- push @heads, [$val, $w];
- foreach my $field (@{ $map->{$val} }, 0) {
- print( ($w++ % 10) == 0 ? "\n\t" : " ", $field, ",");
- }
- }
- print "\n};\n\n";
- print "#define $max ", scalar(@heads), "\n";
- print "static const struct ddb_field_${prefix}s",
- " ddb_field_${prefix}s[$max] = {\n";
- foreach my $h (@heads) {
- print "\t{ $h->[0], $h->[1] },\n";
- }
- print "};\n";
-}
-
-# reverse arrays
-print_reverse_mapping("offset", \%offs_to_fields, "NOFFS");
-print "\n";
-
-# The size->field mapping isn't used by ddb currently, so don't output it
-# print_reverse_mapping("size", \%size_to_fields, "NSIZES");
-