Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ddb By accident db_symstr() was removed, which H?vard po...
details: https://anonhg.NetBSD.org/src/rev/c1e16d310e09
branches: trunk
changeset: 546415:c1e16d310e09
user: ragge <ragge%NetBSD.org@localhost>
date: Mon Apr 28 15:55:45 2003 +0000
description:
By accident db_symstr() was removed, which H?vard pointed out.
Readded now.
diffstat:
sys/ddb/db_sym.c | 75 ++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 51 insertions(+), 24 deletions(-)
diffs (109 lines):
diff -r bbd4422377b5 -r c1e16d310e09 sys/ddb/db_sym.c
--- a/sys/ddb/db_sym.c Mon Apr 28 14:43:32 2003 +0000
+++ b/sys/ddb/db_sym.c Mon Apr 28 15:55:45 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_sym.c,v 1.37 2003/04/25 20:30:58 ragge Exp $ */
+/* $NetBSD: db_sym.c,v 1.38 2003/04/28 15:55:45 ragge Exp $ */
/*
* Mach Operating System
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_sym.c,v 1.37 2003/04/25 20:30:58 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_sym.c,v 1.38 2003/04/28 15:55:45 ragge Exp $");
#include "opt_ddbparam.h"
@@ -280,41 +280,68 @@
unsigned long db_lastsym = (unsigned long)end;
unsigned int db_maxoff = 0x10000000;
-#if 0
void
db_symstr(char *buf, db_expr_t off, db_strategy_t strategy)
{
- db_expr_t d;
- char *filename;
- char *name;
- db_expr_t value;
- int linenum;
- db_sym_t cursym;
+ char *name, *mod;
+ long val;
+
+#ifdef DB_AOUT_SYMBOLS
+ if (using_aout_symtab) {
+ db_expr_t d;
+ char *filename;
+ char *name;
+ db_expr_t value;
+ 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) {
- strcpy(buf, name);
- if (d) {
+ 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) {
+ strcpy(buf, name);
+ if (d) {
+ strcat(buf, "+");
+ 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))
+ sprintf(buf+strlen(buf),
+ " [%s:%d]",
+ filename, linenum);
+ }
+ return;
+ }
+ }
+ strcpy(buf, db_num_to_str(off));
+ return;
+ }
+#endif
+ if (ksyms_getname(&mod, &name, off, strategy|KSYMS_CLOSEST) == 0) {
+ (void)ksyms_getval(mod, name, &val, KSYMS_ANY);
+ if (((off - val) < db_maxoff) && val) {
+ sprintf(buf, "%s:%s", mod, name);
+ if (off - val) {
strcat(buf, "+");
- db_format_radix(buf+strlen(buf), 24, d, TRUE);
+ db_format_radix(buf+strlen(buf),
+ 24, off - val, TRUE);
}
- if (strategy == DB_STGY_PROC) {
- if (db_line_at_pc(cursym, &filename, &linenum,
- off))
- sprintf(buf+strlen(buf),
+#ifdef notyet
+ if (strategy & KSYMS_PROC) {
+ if (ksyms_fmaddr(off, &filename, &linenum) == 0) sprintf(buf+strlen(buf),
" [%s:%d]", filename, linenum);
}
+#endif
return;
}
}
strcpy(buf, db_num_to_str(off));
- return;
}
-#endif
void
db_printsym(db_expr_t off, db_strategy_t strategy,
Home |
Main Index |
Thread Index |
Old Index