The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/ddb/db_kld.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990 Carnegie Mellon University
    4  * All Rights Reserved.
    5  *
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  *
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  *
   16  * Carnegie Mellon requests users of this software to return to
   17  *
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  *
   23  * any improvements or extensions that they make and grant Carnegie the
   24  * rights to redistribute these changes.
   25  *
   26  * $FreeBSD: releng/5.1/sys/ddb/db_kld.c 96155 2002-05-07 10:59:52Z bde $
   27  *      from db_aout.c,v 1.20 1998/06/07 17:09:36 dfr Exp
   28  */
   29 
   30 /*
   31  *      Author: David B. Golub, Carnegie Mellon University
   32  *      Date:   7/90
   33  */
   34 /*
   35  * Symbol table routines for kld maintained kernels.
   36  */
   37 
   38 #include "opt_ddb.h"
   39 
   40 #ifndef DDB_NOKLDSYM
   41 
   42 #include <sys/param.h>
   43 #include <sys/systm.h>
   44 #include <sys/linker.h>
   45 
   46 #include <ddb/ddb.h>
   47 #include <ddb/db_sym.h>
   48 
   49 c_db_sym_t
   50 X_db_lookup(stab, symstr)
   51         db_symtab_t     *stab;
   52         const char *    symstr;
   53 {
   54         c_linker_sym_t sym;
   55 
   56         if (linker_ddb_lookup(symstr, &sym) == 0)
   57             return (c_db_sym_t) sym;
   58         else
   59             return (c_db_sym_t) 0;
   60 }
   61 
   62 c_db_sym_t
   63 X_db_search_symbol(symtab, off, strategy, diffp)
   64         db_symtab_t *   symtab;
   65         register
   66         db_addr_t       off;
   67         db_strategy_t   strategy;
   68         db_expr_t       *diffp;         /* in/out */
   69 {
   70         c_linker_sym_t sym;
   71         long diff;
   72 
   73         if (linker_ddb_search_symbol((caddr_t) off, &sym, &diff) == 0) {
   74                 *diffp = (db_expr_t) diff;
   75                 return (c_db_sym_t) sym;
   76         }
   77 
   78         return 0;
   79 }
   80 
   81 /*
   82  * Return the name and value for a symbol.
   83  */
   84 void
   85 X_db_symbol_values(symtab, dbsym, namep, valuep)
   86         db_symtab_t     *symtab;
   87         c_db_sym_t      dbsym;
   88         const char      **namep;
   89         db_expr_t       *valuep;
   90 {
   91         c_linker_sym_t sym = (c_linker_sym_t) dbsym;
   92         linker_symval_t symval;
   93 
   94         linker_ddb_symbol_values(sym, &symval);
   95         if (namep)
   96             *namep = (const char*) symval.name;
   97         if (valuep)
   98             *valuep = (db_expr_t) symval.value;
   99 }
  100 
  101 
  102 boolean_t
  103 X_db_line_at_pc(symtab, cursym, filename, linenum, off)
  104         db_symtab_t *   symtab;
  105         c_db_sym_t      cursym;
  106         char            **filename;
  107         int             *linenum;
  108         db_expr_t       off;
  109 {
  110         return FALSE;
  111 }
  112 
  113 boolean_t
  114 X_db_sym_numargs(symtab, cursym, nargp, argnamep)
  115         db_symtab_t *   symtab;
  116         c_db_sym_t      cursym;
  117         int             *nargp;
  118         char            **argnamep;
  119 {
  120         return FALSE;
  121 }
  122 
  123 /*
  124  * Initialization routine for a.out files.
  125  */
  126 void
  127 kdb_init()
  128 {
  129         db_add_symbol_table(0, 0, "kernel", 0);
  130 }
  131 
  132 #endif /* !DDB_NOKLDSYM */

Cache object: f68aeff857287071b5046827940ee102


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.