summaryrefslogtreecommitdiff
path: root/sys/ddb/db_aout.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-05-05 12:23:25 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-05-05 12:23:25 +0000
commitafd39cb1e2051218a60f6b8947f463000766403a (patch)
treee8ba7d4efe5e33affb366204d2e8d3d7ea55363f /sys/ddb/db_aout.c
parent5c8c3b86fa94cce5ac8b530555fbe2beb2b750f6 (diff)
add advanced hang analyzer.
idea by theo.
Diffstat (limited to 'sys/ddb/db_aout.c')
-rw-r--r--sys/ddb/db_aout.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c
index 30858067d69..667f62f0bb9 100644
--- a/sys/ddb/db_aout.c
+++ b/sys/ddb/db_aout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_aout.c,v 1.6 1996/04/19 16:08:28 niklas Exp $ */
+/* $OpenBSD: db_aout.c,v 1.7 1996/05/05 12:23:06 mickey Exp $ */
/* $NetBSD: db_aout.c,v 1.14 1996/02/27 20:54:43 gwr Exp $ */
/*
@@ -137,6 +137,24 @@ X_db_sym_init(symtab, esymtab, name)
}
}
+size_t
+X_db_nsyms(stab)
+ db_symtab_t *stab;
+{
+ return (struct nlist *)stab->end - (struct nlist *)stab->start;
+}
+
+db_sym_t
+X_db_isym(stab, i)
+ db_symtab_t *stab;
+ size_t i;
+{
+ if (i >= X_db_nsyms(stab))
+ return NULL;
+ else
+ return (db_sym_t)((struct nlist *)stab->start + i);
+}
+
db_sym_t
X_db_lookup(stab, symstr)
db_symtab_t *stab;
@@ -220,7 +238,8 @@ X_db_symbol_values(sym, namep, valuep)
{
register struct nlist *sp;
- sp = (struct nlist *)sym;
+ if ((sp = (struct nlist *)sym) == NULL)
+ return;
if (namep)
*namep = sp->n_un.n_name;
if (valuep)