diff options
author | bellard <bellard> | 2004-12-19 23:18:01 +0000 |
---|---|---|
committer | bellard <bellard> | 2004-12-19 23:18:01 +0000 |
commit | c013875839c286dd09517ecf68d741d93fd035df (patch) | |
tree | 79b711031ead00eb37303a4adbaf90e6be6d3f11 /qemu/disas.c | |
parent | 248f4b7cab0853480549215fa4bb2c701d663982 (diff) |
SPARC merge
Diffstat (limited to 'qemu/disas.c')
-rw-r--r-- | qemu/disas.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/qemu/disas.c b/qemu/disas.c index 86f29d24..bfab8c3b 100644 --- a/qemu/disas.c +++ b/qemu/disas.c @@ -9,9 +9,7 @@ #include "disas.h" /* Filled in by elfload.c. Simplistic, but will do for now. */ -unsigned int disas_num_syms; -void *disas_symtab; -const char *disas_strtab; +struct syminfo *syminfos = NULL; /* Get LENGTH bytes from info's buffer, at target address memaddr. Transfer them to myaddr. */ @@ -203,19 +201,23 @@ const char *lookup_symbol(void *orig_addr) { unsigned int i; /* Hack, because we know this is x86. */ - Elf32_Sym *sym = disas_symtab; - - for (i = 0; i < disas_num_syms; i++) { - if (sym[i].st_shndx == SHN_UNDEF - || sym[i].st_shndx >= SHN_LORESERVE) - continue; - - if (ELF_ST_TYPE(sym[i].st_info) != STT_FUNC) - continue; - - if ((long)orig_addr >= sym[i].st_value - && (long)orig_addr < sym[i].st_value + sym[i].st_size) - return disas_strtab + sym[i].st_name; + Elf32_Sym *sym; + struct syminfo *s; + + for (s = syminfos; s; s = s->next) { + sym = s->disas_symtab; + for (i = 0; i < s->disas_num_syms; i++) { + if (sym[i].st_shndx == SHN_UNDEF + || sym[i].st_shndx >= SHN_LORESERVE) + continue; + + if (ELF_ST_TYPE(sym[i].st_info) != STT_FUNC) + continue; + + if ((long)orig_addr >= sym[i].st_value + && (long)orig_addr < sym[i].st_value + sym[i].st_size) + return s->disas_strtab + sym[i].st_name; + } } return ""; } |