Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ddb Remove bogus code in the non kernel case involving e...
details: https://anonhg.NetBSD.org/src/rev/8f793a46cae7
branches: trunk
changeset: 773600:8f793a46cae7
user: christos <christos%NetBSD.org@localhost>
date: Thu Feb 09 00:21:23 2012 +0000
description:
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.
diffstat:
sys/ddb/db_sym.c | 89 +++++++++++++++++++++++++------------------------------
1 files changed, 40 insertions(+), 49 deletions(-)
diffs (128 lines):
diff -r da49a29625ae -r 8f793a46cae7 sys/ddb/db_sym.c
--- a/sys/ddb/db_sym.c Wed Feb 08 23:51:37 2012 +0000
+++ b/sys/ddb/db_sym.c Thu Feb 09 00:21:23 2012 +0000
@@ -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 @@
* 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,29 +320,27 @@
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 &&
- ((unsigned int) d < db_maxoff) &&
- value != 0) {
- strlcpy(buf, name, buflen);
- if (d) {
- strlcat(buf, "+", buflen);
- db_format_radix(buf+strlen(buf),
- 24, d, true);
- }
- if (strategy == DB_STGY_PROC) {
- if ((*db_symformat->sym_line_at_pc)
- (NULL, cursym, &filename,
- &linenum, off))
- snprintf(buf + strlen(buf),
- buflen - strlen(buf),
- " [%s:%d]",
- filename, linenum);
- }
- return;
+ cursym = db_search_symbol(off, strategy, &d);
+ db_symbol_values(cursym, &name, &value);
+ if (name != NULL &&
+ ((unsigned int) d < db_maxoff) &&
+ value != 0) {
+ strlcpy(buf, name, buflen);
+ if (d) {
+ strlcat(buf, "+", buflen);
+ db_format_radix(buf+strlen(buf),
+ 24, d, true);
}
+ if (strategy == DB_STGY_PROC) {
+ if ((*db_symformat->sym_line_at_pc)
+ (NULL, cursym, &filename,
+ &linenum, off))
+ snprintf(buf + strlen(buf),
+ buflen - strlen(buf),
+ " [%s:%d]",
+ filename, linenum);
+ }
+ return;
}
strlcpy(buf, db_num_to_str(off), buflen);
return;
@@ -402,28 +395,26 @@
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 &&
- ((unsigned int) d < db_maxoff) &&
- value != 0) {
- (*pr)("%s", name);
- if (d) {
- char tbuf[24];
+ cursym = db_search_symbol(off, strategy, &d);
+ db_symbol_values(cursym, &name, &value);
+ if (name != NULL &&
+ ((unsigned int) d < db_maxoff) &&
+ value != 0) {
+ (*pr)("%s", name);
+ if (d) {
+ char tbuf[24];
- db_format_radix(tbuf, 24, d, true);
- (*pr)("+%s", tbuf);
- }
- if (strategy == DB_STGY_PROC) {
- if ((*db_symformat->sym_line_at_pc)
- (NULL, cursym, &filename,
- &linenum, off))
- (*pr)(" [%s:%d]",
- filename, linenum);
- }
- return;
+ db_format_radix(tbuf, 24, d, true);
+ (*pr)("+%s", tbuf);
}
+ if (strategy == DB_STGY_PROC) {
+ if ((*db_symformat->sym_line_at_pc)
+ (NULL, cursym, &filename,
+ &linenum, off))
+ (*pr)(" [%s:%d]",
+ filename, linenum);
+ }
+ return;
}
(*pr)(db_num_to_str(off));
return;
Home |
Main Index |
Thread Index |
Old Index