version 1.2, 2002/03/15 16:41:06 |
version 1.3, 2002/03/15 17:49:51 |
|
|
warnx("sym_init_exec: %s is not a supported file format", name); |
warnx("sym_init_exec: %s is not a supported file format", name); |
|
|
if (ps->ps_sops) { |
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) |
if (ps->ps_sym_exe) |
ps->ps_sym_exe->st_flags |= ST_EXEC; |
ps->ps_sym_exe->st_flags |= ST_EXEC; |
} |
} |
|
|
* it's already there. |
* it's already there. |
*/ |
*/ |
struct sym_table * |
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; |
struct sym_table *st; |
|
|
TAILQ_FOREACH(st, &ps->ps_syms, st_list) { |
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); |
return (st); |
} |
} |
|
|
|
|
TAILQ_INSERT_TAIL(&ps->ps_syms, st, st_list); |
TAILQ_INSERT_TAIL(&ps->ps_syms, st, st_list); |
strlcpy(st->st_fname, name, sizeof(st->st_fname)); |
strlcpy(st->st_fname, name, sizeof(st->st_fname)); |
} |
} |
|
|
|
st->st_offs = offs; |
|
|
return (st); |
return (st); |
} |
} |