Remove bogus code in the non kernel case involving end[]. In this case

end[] is the end of the crash program symbols, so using that as the
end of the kernel symbol table is just wrong.
This commit is contained in:
christos 2012-02-09 00:21:23 +00:00
parent 8fc4ac1ef2
commit 8e619ae19a

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_sym.c,v 1.61 2011/04/11 04:26:18 mrg Exp $ */
/* $NetBSD: db_sym.c,v 1.62 2012/02/09 00:21:23 christos Exp $ */
/*
* Mach Operating System
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: db_sym.c,v 1.61 2011/04/11 04:26:18 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: db_sym.c,v 1.62 2012/02/09 00:21:23 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddbparam.h"
@ -300,12 +300,7 @@ db_symbol_values(db_sym_t sym, const char **namep, db_expr_t *valuep)
* bogus symbol associations, e.g. 3 might get some absolute
* value like _INCLUDE_VERSION or something, therefore we do
* not accept symbols whose value is zero (and use plain hex).
* Also, avoid printing as "end+0x????" which is useless.
* The variable db_lastsym is used instead of "end" in case we
* add support for symbols in loadable driver modules.
*/
extern char end[];
unsigned long db_lastsym = (unsigned long)end;
unsigned int db_maxoff = 0x100000;
void
@ -325,7 +320,6 @@ db_symstr(char *buf, size_t buflen, db_expr_t off, db_strategy_t strategy)
int linenum;
db_sym_t cursym;
if ((unsigned long) off <= db_lastsym) {
cursym = db_search_symbol(off, strategy, &d);
db_symbol_values(cursym, &name, &value);
if (name != NULL &&
@ -348,7 +342,6 @@ db_symstr(char *buf, size_t buflen, db_expr_t off, db_strategy_t strategy)
}
return;
}
}
strlcpy(buf, db_num_to_str(off), buflen);
return;
}
@ -402,7 +395,6 @@ db_printsym(db_expr_t off, db_strategy_t strategy,
int linenum;
db_sym_t cursym;
if ((unsigned long) off <= db_lastsym) {
cursym = db_search_symbol(off, strategy, &d);
db_symbol_values(cursym, &name, &value);
if (name != NULL &&
@ -424,7 +416,6 @@ db_printsym(db_expr_t off, db_strategy_t strategy,
}
return;
}
}
(*pr)(db_num_to_str(off));
return;
}