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_sym.h

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 /*      $NetBSD: db_sym.h,v 1.19 2003/05/16 15:02:08 itojun Exp $       */
    2 
    3 /*
    4  * Mach Operating System
    5  * Copyright (c) 1991,1990 Carnegie Mellon University
    6  * All Rights Reserved.
    7  *
    8  * Permission to use, copy, modify and distribute this software and its
    9  * documentation is hereby granted, provided that both the copyright
   10  * notice and this permission notice appear in all copies of the
   11  * software, derivative works or modified versions, and any portions
   12  * thereof, and that both notices appear in supporting documentation.
   13  *
   14  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   15  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   16  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   17  *
   18  * Carnegie Mellon requests users of this software to return to
   19  *
   20  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   21  *  School of Computer Science
   22  *  Carnegie Mellon University
   23  *  Pittsburgh PA 15213-3890
   24  *
   25  * any improvements or extensions that they make and grant Carnegie the
   26  * rights to redistribute these changes.
   27  *
   28  *      Author: Alessandro Forin, Carnegie Mellon University
   29  *      Date:   8/90
   30  */
   31 #include <sys/ksyms.h>
   32 
   33 typedef vaddr_t db_sym_t;
   34 #define DB_SYM_NULL     ((db_sym_t)0)
   35 typedef int             db_strategy_t;  /* search strategy */
   36 
   37 #define DB_STGY_ANY     (KSYMS_ANY|KSYMS_CLOSEST)    /* anything goes */
   38 #define DB_STGY_XTRN    (KSYMS_EXTERN|KSYMS_CLOSEST) /* only external symbols */
   39 #define DB_STGY_PROC    (KSYMS_PROC|KSYMS_CLOSEST)   /* only procedures */
   40 
   41 #ifdef DB_AOUT_SYMBOLS
   42 /*
   43  * This struct is unused.
   44  */
   45 typedef struct {
   46         const char      *name;          /* symtab name */
   47         char            *start;         /* symtab location */
   48         char            *end;
   49         char            *private;       /* optional machdep pointer */
   50 } db_symtab_t;
   51 
   52 /*
   53  * Internal db_forall function calling convention:
   54  *
   55  * (*db_forall_func)(stab, sym, name, suffix, prefix, arg);
   56  *
   57  * stab is the symbol table, symbol the (opaque) symbol pointer,
   58  * name the name of the symbol, suffix a string representing
   59  * the type, prefix an initial ignorable function prefix (e.g. "_"
   60  * in a.out), and arg an opaque argument to be passed in.
   61  */
   62 typedef void (db_forall_func_t)
   63         (db_symtab_t *, db_sym_t, char *, char *, int, void *);
   64 
   65 /*
   66  * A symbol table may be in one of many formats.  All symbol tables
   67  * must be of the same format as the master kernel symbol table.
   68  */
   69 typedef struct {
   70         const char     *sym_format;
   71         boolean_t       (*sym_init)(int, void *, void *, const char *);
   72         db_sym_t        (*sym_lookup)(db_symtab_t *, char *);
   73         db_sym_t        (*sym_search)(db_symtab_t *, db_addr_t, db_strategy_t,
   74                             db_expr_t *);
   75         void            (*sym_value)(db_symtab_t *, db_sym_t, char **,
   76                             db_expr_t *);
   77         boolean_t       (*sym_line_at_pc)(db_symtab_t *, db_sym_t, char **,
   78                             int *, db_expr_t);
   79         boolean_t       (*sym_numargs)(db_symtab_t *, db_sym_t, int *, char **);
   80         void            (*sym_forall)(db_symtab_t *,
   81                             db_forall_func_t *db_forall_func, void *);
   82 } db_symformat_t;
   83 
   84 #endif
   85 
   86 extern unsigned int db_maxoff;          /* like gdb's "max-symbolic-offset" */
   87 
   88 /*
   89  * Functions exported by the symtable module
   90  */
   91 boolean_t       db_eqname(char *, char *, int);
   92                                         /* strcmp, modulo leading char */
   93 
   94 int             db_value_of_name(char *, db_expr_t *);
   95                                         /* find symbol value given name */
   96 
   97 void            db_sifting(char *, int);
   98                                 /* print partially matching symbol names */
   99 
  100 db_sym_t        db_search_symbol(db_addr_t, db_strategy_t, db_expr_t *);
  101                                         /* find symbol given value */
  102 
  103 void            db_symbol_values(db_sym_t, char **, db_expr_t *);
  104                                         /* return name and value of symbol */
  105 
  106 #define db_find_sym_and_offset(val,namep,offp)  \
  107         db_symbol_values(db_search_symbol(val,DB_STGY_ANY,offp),namep,0)
  108                                         /* find name&value given approx val */
  109 
  110 #define db_find_xtrn_sym_and_offset(val,namep,offp)     \
  111         db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,0)
  112                                         /* ditto, but no locals */
  113 
  114 void            db_symstr(char *, size_t, db_expr_t, db_strategy_t);
  115 void            db_printsym(db_expr_t, db_strategy_t,
  116                     void(*)(const char *, ...));
  117                                         /* print closest symbol to a value */
  118 int             db_sym_numargs(db_sym_t, int *, char **);

Cache object: ae8445483cdadacda9080d439a622dc5


[ 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.