From 7085e708787865e0c0c0c0067a58538cd34b52e7 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 7 May 2002 10:59:52 +0000 Subject: [PATCH] Reconnect db_elf.c to the build (now under "options DDB_NOKLDSYM"). It doesn't actually build yet. --- sys/conf/NOTES | 8 ++++++++ sys/conf/files | 1 + sys/conf/options | 1 + sys/ddb/db_elf.c | 8 ++++++-- sys/ddb/db_kld.c | 6 ++++++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index c5f1f7f21d8e..06f4ed34a7ec 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -185,6 +185,14 @@ options SYSVMSG # options DDB +# +# Use direct symbol lookup routines for ddb instead of the kernel linker +# ones, so that symbols (mostly) work before the kernel linker has been +# initialized. This is not the default because it breaks ddb's lookup of +# symbols in loaded modules. +# +#!options DDB_NOKLDSYM + # # Don't drop into DDB for a panic. Intended for unattended operation # where you may want to drop to DDB from the console, but still want diff --git a/sys/conf/files b/sys/conf/files index 605d6542348f..e7f520a6430c 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -177,6 +177,7 @@ crypto/sha2/sha2.c optional ipsec ddb/db_access.c optional ddb ddb/db_break.c optional ddb ddb/db_command.c optional ddb +ddb/db_elf.c optional ddb ddb/db_examine.c optional ddb ddb/db_expr.c optional ddb ddb/db_input.c optional ddb diff --git a/sys/conf/options b/sys/conf/options index 55eeecc94bb0..dc617f34d824 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -62,6 +62,7 @@ COMPAT_SUNOS opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR DDB +DDB_NOKLDSYM opt_ddb.h DDB_UNATTENDED opt_ddb.h GDB_REMOTE_CHAT opt_ddb.h NODEVFS opt_devfs.h diff --git a/sys/ddb/db_elf.c b/sys/ddb/db_elf.c index b4fd53dd118d..97e97cabf167 100644 --- a/sys/ddb/db_elf.c +++ b/sys/ddb/db_elf.c @@ -38,10 +38,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if defined(__ELF__) && defined(__alpha__) +#ifdef __ELF__ #include "opt_ddb.h" +#ifdef DDB_NOKLDSYM + #include #include #include @@ -378,4 +380,6 @@ kdb_init(void) X_db_sym_init(ksym_start, ksym_end, "kernel"); } -#endif +#endif /* DDB_NOKLDSYM */ + +#endif /* __ELF__ */ diff --git a/sys/ddb/db_kld.c b/sys/ddb/db_kld.c index 9599299a3ebe..903a589671af 100644 --- a/sys/ddb/db_kld.c +++ b/sys/ddb/db_kld.c @@ -35,6 +35,10 @@ * Symbol table routines for kld maintained kernels. */ +#include "opt_ddb.h" + +#ifndef DDB_NOKLDSYM + #include #include #include @@ -124,3 +128,5 @@ kdb_init() { db_add_symbol_table(0, 0, "kernel", 0); } + +#endif /* !DDB_NOKLDSYM */