summaryrefslogtreecommitdiff
path: root/usr.bin/pmdb/symbol.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-03-15 17:49:52 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-03-15 17:49:52 +0000
commit51c05938a19431dac43eee9d33a9eaeb0d38c5b5 (patch)
tree156fdf05e9a83b02329197200116d23f3ba98a22 /usr.bin/pmdb/symbol.c
parente2b43d09082dffa4ad720fe2b237c1bc33bcd098 (diff)
Move the linking offset from the symbol format dependent structs
to struct sym_table. Allow callers to specify linking offset to st_open.
Diffstat (limited to 'usr.bin/pmdb/symbol.c')
-rw-r--r--usr.bin/pmdb/symbol.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/pmdb/symbol.c b/usr.bin/pmdb/symbol.c
index d4d9bd3e280..43937d60bfa 100644
--- a/usr.bin/pmdb/symbol.c
+++ b/usr.bin/pmdb/symbol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: symbol.c,v 1.2 2002/03/15 16:41:06 jason Exp $ */
+/* $OpenBSD: symbol.c,v 1.3 2002/03/15 17:49:51 art Exp $ */
/*
* Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -51,7 +51,8 @@ sym_init_exec(struct pstate *ps, const char *name)
warnx("sym_init_exec: %s is not a supported file format", name);
if (ps->ps_sops) {
- ps->ps_sym_exe = st_open(ps, name);
+ /* XXX - this 0 doesn't have to be correct.. */
+ ps->ps_sym_exe = st_open(ps, name, 0);
if (ps->ps_sym_exe)
ps->ps_sym_exe->st_flags |= ST_EXEC;
}
@@ -139,12 +140,12 @@ sym_print(struct pstate *ps, reg pc, char *buf, size_t buflen)
* it's already there.
*/
struct sym_table *
-st_open(struct pstate *ps, const char *name)
+st_open(struct pstate *ps, const char *name, reg offs)
{
struct sym_table *st;
TAILQ_FOREACH(st, &ps->ps_syms, st_list) {
- if (!strcmp(name, st->st_fname))
+ if (!strcmp(name, st->st_fname) && (st->st_offs == offs))
return (st);
}
@@ -155,6 +156,8 @@ st_open(struct pstate *ps, const char *name)
strlcpy(st->st_fname, name, sizeof(st->st_fname));
}
+ st->st_offs = offs;
+
return (st);
}