Martin Pieuchot
2016-02-11 10:54:56 UTC
There's only one symbol table since we no longer support LKMs. So this
function is useless.
Ok to kill it?
Index: ddb/db_sym.c
===================================================================
RCS file: /cvs/src/sys/ddb/db_sym.c,v
retrieving revision 1.43
diff -u -p -r1.43 db_sym.c
--- ddb/db_sym.c 27 Jan 2016 10:37:12 -0000 1.43
+++ ddb/db_sym.c 11 Feb 2016 10:52:24 -0000
@@ -245,34 +245,6 @@ db_lookup(char *symstr)
}
/*
- * Does this symbol name appear in more than one symbol table?
- * Used by db_symbol_values to decide whether to qualify a symbol.
- */
-boolean_t db_qualify_ambiguous_names = FALSE;
-
-boolean_t
-db_symbol_is_ambiguous(db_sym_t sym)
-{
- char *sym_name;
- int i;
- boolean_t found_once = FALSE;
-
- if (!db_qualify_ambiguous_names)
- return FALSE;
-
- db_symbol_values(sym, &sym_name, 0);
- for (i = 0; i < MAXNOSYMTABS; i++) {
- if (db_symtabs[i].name &&
- db_elf_sym_lookup(&db_symtabs[i], sym_name)) {
- if (found_once)
- return TRUE;
- found_once = TRUE;
- }
- }
- return FALSE;
-}
-
-/*
* Find the closest symbol to val, and return its name
* and the difference between val and the symbol found.
*/
@@ -315,8 +287,6 @@ db_symbol_values(db_sym_t sym, char **na
db_elf_sym_values(db_last_symtab, sym, namep, &value);
- if (db_symbol_is_ambiguous(sym))
- *namep = db_qualify(sym, db_last_symtab->name);
if (valuep)
*valuep = value;
}
Index: ddb/db_sym.h
===================================================================
RCS file: /cvs/src/sys/ddb/db_sym.h,v
retrieving revision 1.20
diff -u -p -r1.20 db_sym.h
--- ddb/db_sym.h 27 Jan 2016 10:37:12 -0000 1.20
+++ ddb/db_sym.h 11 Feb 2016 10:52:24 -0000
@@ -74,11 +74,6 @@ typedef int db_strategy_t; /* search st
*/
typedef void (db_forall_func_t)(db_symtab_t *, db_sym_t, char *, char *, int, void *);
-extern boolean_t db_qualify_ambiguous_names;
- /* if TRUE, check across symbol tables
- * for multiple occurrences of a name.
- * Might slow down quite a bit */
-
extern unsigned int db_maxoff; /* like gdb's "max-symbolic-offset" */
/*
* Functions exported by the symtable module
@@ -96,8 +91,6 @@ int db_value_of_name(char *, db_expr_t *
/* find symbol value given name */
db_sym_t db_lookup(char *);
-
-boolean_t db_symbol_is_ambiguous(db_sym_t);
db_sym_t db_search_symbol(db_addr_t, db_strategy_t, db_expr_t *);
/* find symbol given value */
function is useless.
Ok to kill it?
Index: ddb/db_sym.c
===================================================================
RCS file: /cvs/src/sys/ddb/db_sym.c,v
retrieving revision 1.43
diff -u -p -r1.43 db_sym.c
--- ddb/db_sym.c 27 Jan 2016 10:37:12 -0000 1.43
+++ ddb/db_sym.c 11 Feb 2016 10:52:24 -0000
@@ -245,34 +245,6 @@ db_lookup(char *symstr)
}
/*
- * Does this symbol name appear in more than one symbol table?
- * Used by db_symbol_values to decide whether to qualify a symbol.
- */
-boolean_t db_qualify_ambiguous_names = FALSE;
-
-boolean_t
-db_symbol_is_ambiguous(db_sym_t sym)
-{
- char *sym_name;
- int i;
- boolean_t found_once = FALSE;
-
- if (!db_qualify_ambiguous_names)
- return FALSE;
-
- db_symbol_values(sym, &sym_name, 0);
- for (i = 0; i < MAXNOSYMTABS; i++) {
- if (db_symtabs[i].name &&
- db_elf_sym_lookup(&db_symtabs[i], sym_name)) {
- if (found_once)
- return TRUE;
- found_once = TRUE;
- }
- }
- return FALSE;
-}
-
-/*
* Find the closest symbol to val, and return its name
* and the difference between val and the symbol found.
*/
@@ -315,8 +287,6 @@ db_symbol_values(db_sym_t sym, char **na
db_elf_sym_values(db_last_symtab, sym, namep, &value);
- if (db_symbol_is_ambiguous(sym))
- *namep = db_qualify(sym, db_last_symtab->name);
if (valuep)
*valuep = value;
}
Index: ddb/db_sym.h
===================================================================
RCS file: /cvs/src/sys/ddb/db_sym.h,v
retrieving revision 1.20
diff -u -p -r1.20 db_sym.h
--- ddb/db_sym.h 27 Jan 2016 10:37:12 -0000 1.20
+++ ddb/db_sym.h 11 Feb 2016 10:52:24 -0000
@@ -74,11 +74,6 @@ typedef int db_strategy_t; /* search st
*/
typedef void (db_forall_func_t)(db_symtab_t *, db_sym_t, char *, char *, int, void *);
-extern boolean_t db_qualify_ambiguous_names;
- /* if TRUE, check across symbol tables
- * for multiple occurrences of a name.
- * Might slow down quite a bit */
-
extern unsigned int db_maxoff; /* like gdb's "max-symbolic-offset" */
/*
* Functions exported by the symtable module
@@ -96,8 +91,6 @@ int db_value_of_name(char *, db_expr_t *
/* find symbol value given name */
db_sym_t db_lookup(char *);
-
-boolean_t db_symbol_is_ambiguous(db_sym_t);
db_sym_t db_search_symbol(db_addr_t, db_strategy_t, db_expr_t *);
/* find symbol given value */