summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-08-13 00:41:35 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-08-13 00:41:35 +0000
commit6abab69d1979a465edfbe38d7068261d441373cf (patch)
tree182cca928f2c1875945bfd4932adeb8ed24b7cc2
parent9c881530284ee8f126c0c60ee13a84e357d7b328 (diff)
Kludge to make DDB reverse symbol lookup work again.
I will soon deal with this mess in a 64-bit clean way which the old code was anything but.
-rw-r--r--sys/ddb/db_aout.c6
-rw-r--r--sys/ddb/db_sym.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c
index edba6dc76fe..79f4abc76a7 100644
--- a/sys/ddb/db_aout.c
+++ b/sys/ddb/db_aout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_aout.c,v 1.8 1996/05/10 13:58:43 mickey Exp $ */
+/* $OpenBSD: db_aout.c,v 1.9 1996/08/13 00:41:33 niklas Exp $ */
/* $NetBSD: db_aout.c,v 1.14 1996/02/27 20:54:43 gwr Exp $ */
/*
@@ -186,7 +186,7 @@ X_db_search_symbol(symtab, off, strategy, diffp)
db_strategy_t strategy;
db_expr_t *diffp; /* in/out */
{
- register unsigned int diff = *diffp;
+ register db_expr_t diff = *diffp;
register struct nlist *symp = 0;
register struct nlist *sp, *ep;
@@ -199,7 +199,7 @@ X_db_search_symbol(symtab, off, strategy, diffp)
if ((sp->n_type & N_STAB) != 0 || (sp->n_type & N_TYPE) == N_FN)
continue;
if (off >= sp->n_value) {
- if (off - sp->n_value < diff) {
+ if (off - sp->n_value < diff || diff < 0) {
diff = off - sp->n_value;
symp = sp;
if (diff == 0 &&
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
index d9ee76e3deb..f2e8cf6d23a 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_sym.c,v 1.12 1996/08/04 01:27:46 niklas Exp $ */
+/* $OpenBSD: db_sym.c,v 1.13 1996/08/13 00:41:34 niklas Exp $ */
/* $NetBSD: db_sym.c,v 1.12 1996/02/05 01:57:15 christos Exp $ */
/*
@@ -268,11 +268,11 @@ db_search_symbol( val, strategy, offp)
db_symtab_t st;
db_sym_t ret = DB_SYM_NULL, sym;
- newdiff = diff = ~0;
+ newdiff = diff = -1;
db_last_symtab = 0;
for (st = db_symtabs.tqh_first; st != NULL; st = st->list.tqe_next) {
sym = X_db_search_symbol(st, val, strategy, &newdiff);
- if (newdiff < diff) {
+ if (newdiff < diff || diff < 0) {
db_last_symtab = st;
diff = newdiff;
ret = sym;