Source-Changes-HG archive

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

[src/trunk]: src obsolete DB_AOUT_SYMBOLS. however, we need to leave most of...



details:   https://anonhg.NetBSD.org/src/rev/332a0669699e
branches:  trunk
changeset: 764088:332a0669699e
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Apr 11 04:22:30 2011 +0000

description:
obsolete DB_AOUT_SYMBOLS.  however, we need to leave most of the code
in db_sym.[ch] as it is used by the elf version of crash(8).

i will be cleaning up the db_sym.c code in a follow up commit to avoid
having dead code compiled.

diffstat:

 sys/arch/acorn26/include/db_machdep.h |    3 +-
 sys/arch/hp300/include/db_machdep.h   |    4 +-
 sys/arch/i386/i386/db_machdep.c       |   14 +-
 sys/arch/i386/include/db_machdep.h    |    5 +-
 sys/arch/luna68k/include/db_machdep.h |    3 +-
 sys/arch/m68k/include/db_machdep.h    |    5 +-
 sys/arch/mvme68k/include/db_machdep.h |    3 +-
 sys/arch/pmax/include/db_machdep.h    |    3 +-
 sys/arch/sparc/include/db_machdep.h   |    5 +-
 sys/arch/x86/x86/db_trace.c           |    8 +-
 sys/ddb/db_aout.c                     |  409 ----------------------------------
 sys/ddb/db_aout.h                     |  120 ---------
 sys/ddb/db_sym.c                      |   56 ++--
 sys/ddb/db_sym.h                      |    8 +-
 sys/ddb/files.ddb                     |    3 +-
 usr.sbin/crash/Makefile               |    4 +-
 16 files changed, 62 insertions(+), 591 deletions(-)

diffs (truncated from 958 to 300 lines):

diff -r 45d8cb40694f -r 332a0669699e sys/arch/acorn26/include/db_machdep.h
--- a/sys/arch/acorn26/include/db_machdep.h     Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/acorn26/include/db_machdep.h     Mon Apr 11 04:22:30 2011 +0000
@@ -1,9 +1,8 @@
-/* $NetBSD: db_machdep.h,v 1.7 2009/01/14 23:14:48 bjh21 Exp $ */
+/* $NetBSD: db_machdep.h,v 1.8 2011/04/11 04:22:30 mrg Exp $ */
 
 #include <arm/db_machdep.h>
 
 /* acorn26 uses ELF */
-#undef DB_AOUT_SYMBOLS
 #define DB_ELF_SYMBOLS
 #define DB_ELFSIZE 32
 
diff -r 45d8cb40694f -r 332a0669699e sys/arch/hp300/include/db_machdep.h
--- a/sys/arch/hp300/include/db_machdep.h       Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/hp300/include/db_machdep.h       Mon Apr 11 04:22:30 2011 +0000
@@ -1,6 +1,4 @@
-/*     $NetBSD: db_machdep.h,v 1.4 2005/12/06 17:05:02 tsutsui Exp $   */
+/*     $NetBSD: db_machdep.h,v 1.5 2011/04/11 04:22:30 mrg Exp $       */
 
 /* Just use the common m68k definition */
 #include <m68k/db_machdep.h>
-
-#undef DB_AOUT_SYMBOLS
diff -r 45d8cb40694f -r 332a0669699e sys/arch/i386/i386/db_machdep.c
--- a/sys/arch/i386/i386/db_machdep.c   Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/i386/i386/db_machdep.c   Mon Apr 11 04:22:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.c,v 1.1 2011/04/10 20:36:48 christos Exp $  */
+/*     $NetBSD: db_machdep.c,v 1.2 2011/04/11 04:22:31 mrg Exp $       */
 
 /* 
  * Mach Operating System
@@ -27,15 +27,25 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.1 2011/04/10 20:36:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.2 2011/04/11 04:22:31 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
 
+#ifndef _KERNEL
+#include <stdbool.h>
+#endif
+
 #include <machine/frame.h>
 #include <machine/trap.h>
 #include <machine/intrdefs.h>
+#include <machine/cpu.h>
+
+#include <uvm/uvm_prot.h>
+/* We need to include both for ddb and crash(8).  */
+#include <uvm/uvm_pmap.h>
+#include <machine/pmap.h>
 
 #include <machine/db_machdep.h>
 #include <ddb/db_sym.h>
diff -r 45d8cb40694f -r 332a0669699e sys/arch/i386/include/db_machdep.h
--- a/sys/arch/i386/include/db_machdep.h        Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/i386/include/db_machdep.h        Mon Apr 11 04:22:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.h,v 1.28 2011/04/10 20:36:48 christos Exp $ */
+/*     $NetBSD: db_machdep.h,v 1.29 2011/04/11 04:22:30 mrg Exp $      */
 
 /* 
  * Mach Operating System
@@ -139,9 +139,8 @@
 #endif
 
 /*
- * We use either a.out or Elf32 symbols in DDB.
+ * We use Elf32 symbols in DDB.
  */
-#define        DB_AOUT_SYMBOLS
 #define        DB_ELF_SYMBOLS
 #define        DB_ELFSIZE      32
 
diff -r 45d8cb40694f -r 332a0669699e sys/arch/luna68k/include/db_machdep.h
--- a/sys/arch/luna68k/include/db_machdep.h     Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/luna68k/include/db_machdep.h     Mon Apr 11 04:22:30 2011 +0000
@@ -1,8 +1,7 @@
-/*     $NetBSD: db_machdep.h,v 1.2 2001/12/24 17:57:19 chs Exp $       */
+/*     $NetBSD: db_machdep.h,v 1.3 2011/04/11 04:22:30 mrg Exp $       */
 
 /* Just use the common m68k definition */
 #include <m68k/db_machdep.h>
 
-#undef DB_AOUT_SYMBOLS
 #define DB_ELF_SYMBOLS
 #define DB_ELFSIZE 32
diff -r 45d8cb40694f -r 332a0669699e sys/arch/m68k/include/db_machdep.h
--- a/sys/arch/m68k/include/db_machdep.h        Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/m68k/include/db_machdep.h        Mon Apr 11 04:22:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.h,v 1.28 2011/01/14 02:06:27 rmind Exp $    */
+/*     $NetBSD: db_machdep.h,v 1.29 2011/04/11 04:22:30 mrg Exp $      */
 
 /* 
  * Mach Operating System
@@ -104,9 +104,8 @@
 #endif /* _KERNEL */
 
 /*
- * We use either a.out or Elf32 symbols in DDB.
+ * We use Elf32 symbols in DDB.
  */
-#define        DB_AOUT_SYMBOLS
 #define        DB_ELF_SYMBOLS
 #define        DB_ELFSIZE      32
 
diff -r 45d8cb40694f -r 332a0669699e sys/arch/mvme68k/include/db_machdep.h
--- a/sys/arch/mvme68k/include/db_machdep.h     Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/mvme68k/include/db_machdep.h     Mon Apr 11 04:22:30 2011 +0000
@@ -1,8 +1,7 @@
-/*     $NetBSD: db_machdep.h,v 1.2 2000/12/02 13:57:05 scw Exp $       */
+/*     $NetBSD: db_machdep.h,v 1.3 2011/04/11 04:22:30 mrg Exp $       */
 
 /* Just use the common m68k definition */
 #include <m68k/db_machdep.h>
 
-#undef DB_AOUT_SYMBOLS
 #define DB_ELF_SYMBOLS
 #define DB_ELFSIZE 32
diff -r 45d8cb40694f -r 332a0669699e sys/arch/pmax/include/db_machdep.h
--- a/sys/arch/pmax/include/db_machdep.h        Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/pmax/include/db_machdep.h        Mon Apr 11 04:22:30 2011 +0000
@@ -1,11 +1,10 @@
-/*     $NetBSD: db_machdep.h,v 1.3 2000/01/09 15:34:42 ad Exp $        */
+/*     $NetBSD: db_machdep.h,v 1.4 2011/04/11 04:22:31 mrg Exp $       */
 
 #ifndef _PMAX_DB_MACHDEP_H_
 #define _PMAX_DB_MACHDEP_H_
 
 #define DB_ELF_SYMBOLS
 #define DB_ELFSIZE     32
-#define DB_AOUT_SYMBOLS
 
 #include <mips/db_machdep.h>
 
diff -r 45d8cb40694f -r 332a0669699e sys/arch/sparc/include/db_machdep.h
--- a/sys/arch/sparc/include/db_machdep.h       Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/sparc/include/db_machdep.h       Mon Apr 11 04:22:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.h,v 1.24 2011/01/14 02:06:31 rmind Exp $ */
+/*     $NetBSD: db_machdep.h,v 1.25 2011/04/11 04:22:31 mrg Exp $ */
 
 /*
  * Mach Operating System
@@ -111,9 +111,8 @@
 int kdb_trap(int, struct trapframe *);
 
 /*
- * We use both a.out and elf symbols in DDB.
+ * We use elf symbols in DDB.
  */
-#define        DB_AOUT_SYMBOLS
 #define        DB_ELF_SYMBOLS
 #define DB_ELFSIZE 32
 
diff -r 45d8cb40694f -r 332a0669699e sys/arch/x86/x86/db_trace.c
--- a/sys/arch/x86/x86/db_trace.c       Mon Apr 11 02:21:17 2011 +0000
+++ b/sys/arch/x86/x86/db_trace.c       Mon Apr 11 04:22:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.1 2011/04/10 20:36:49 christos Exp $    */
+/*     $NetBSD: db_trace.c,v 1.2 2011/04/11 04:22:31 mrg Exp $ */
 
 /* 
  * Mach Operating System
@@ -27,15 +27,19 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.1 2011/04/10 20:36:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.2 2011/04/11 04:22:31 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
 
+#include <uvm/uvm_prot.h>
+#include <uvm/uvm_pmap.h>
+
 #include <machine/frame.h>
 #include <machine/trap.h>
 #include <machine/intrdefs.h>
+#include <machine/pmap.h>
 
 #include <machine/db_machdep.h>
 #include <ddb/db_sym.h>
diff -r 45d8cb40694f -r 332a0669699e sys/ddb/db_aout.c
--- a/sys/ddb/db_aout.c Mon Apr 11 02:21:17 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,409 +0,0 @@
-/*     $NetBSD: db_aout.c,v 1.41 2007/02/22 06:41:00 thorpej Exp $     */
-
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
- *  School of Computer Science
- *  Carnegie Mellon University
- *  Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_aout.c,v 1.41 2007/02/22 06:41:00 thorpej Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-
-#include <machine/db_machdep.h>
-
-#include <ddb/db_sym.h>
-#include <ddb/db_output.h>
-#include <ddb/db_extern.h>
-
-#ifdef DB_AOUT_SYMBOLS
-
-#include <ddb/db_aout.h>
-
-static bool db_aout_sym_init(int, void *, void *, const char *);
-static db_sym_t        db_aout_lookup(db_symtab_t *, const char *);
-static db_sym_t        db_aout_search_symbol(db_symtab_t *, db_addr_t, db_strategy_t,
-                   db_expr_t *);
-static void    db_aout_symbol_values(db_symtab_t *, db_sym_t, const char **,
-                   db_expr_t *);
-static bool db_aout_line_at_pc(db_symtab_t *, db_sym_t, char **, int *,
-                   db_expr_t);
-static bool db_aout_sym_numargs(db_symtab_t *, db_sym_t, int *, char **);
-static void    db_aout_forall(db_symtab_t *, db_forall_func_t db_forall_func,
-                   void *);
-static int db_add_symbol_table(char *, char *, const char *, char *);
-
-/* Only one symbol table, please */
-static db_symtab_t db_symtabs;
-
-
-const db_symformat_t db_symformat_aout = {
-       "a.out",
-       db_aout_sym_init,
-       db_aout_lookup,
-       db_aout_search_symbol,
-       db_aout_symbol_values,
-       db_aout_line_at_pc,
-       db_aout_sym_numargs,
-       db_aout_forall
-};
-
-/*
- * An a.out symbol table as loaded into the kernel debugger:
- *
- * symtab      -> size of symbol entries, in bytes
- * sp          -> first symbol entry
- *                ...
- * ep          -> last symbol entry + 1
- * strtab      == start of string table
- *                size of string table in bytes,
- *                including this word
- *             -> strings
- */
-
-/*
- * Find the symbol table and strings; tell ddb about them.
- */
-static bool
-db_aout_sym_init(
-       int symsize,            /* size of symbol table */
-       void *vsymtab,          /* pointer to start of symbol table */
-       void *vesymtab,         /* pointer to end of string table,
-                                  for checking - rounded up to integer
-                                  boundary */
-       const char *name
-)
-{
-       struct nlist    *sym_start, *sym_end;
-       struct nlist    *sp;
-       char *strtab;
-       int slen, bad = 0;



Home | Main Index | Thread Index | Old Index