summaryrefslogtreecommitdiff
path: root/disas.h
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-22 15:11:31 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-22 15:11:31 +0000
commit49918a752b739041c7afb205f7158e61c0874267 (patch)
treed8da8087010dc5f06f02e972e047505d284fefaf /disas.h
parentf16a0db323e1a8c0044696815cceeb98706f2243 (diff)
downloadqemu-49918a752b739041c7afb205f7158e61c0874267.tar.gz
qemu-49918a752b739041c7afb205f7158e61c0874267.tar.bz2
qemu-49918a752b739041c7afb205f7158e61c0874267.zip
* Use function pointers for symbol lookup (currently for elf32 and elf64,
could be expanded). This also fixes the bug with mips elf64 symbols in current Qemu trunk. * Use quicksort and binary search for symbol lookup. * Remove unneeded entries from symbol table. This reduced a typical table size (linux mips kernel) from 1764487 to 11656 entries. Signed-off-by: Stefan Weil <weil@mail.berlios.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5510 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'disas.h')
-rw-r--r--disas.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/disas.h b/disas.h
index ee0a79c259..13c2aa3616 100644
--- a/disas.h
+++ b/disas.h
@@ -10,12 +10,24 @@ void monitor_disas(CPUState *env,
/* Look up symbol for debugging purpose. Returns "" if unknown. */
const char *lookup_symbol(target_ulong orig_addr);
-/* Filled in by elfload.c. Simplistic, but will do for now. */
-extern struct syminfo {
+struct syminfo;
+struct elf32_sym;
+struct elf64_sym;
+
+typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
+
+struct syminfo {
+ lookup_symbol_t lookup_symbol;
unsigned int disas_num_syms;
- void *disas_symtab;
+ union {
+ struct elf32_sym *elf32;
+ struct elf64_sym *elf64;
+ } disas_symtab;
const char *disas_strtab;
struct syminfo *next;
-} *syminfos;
+};
+
+/* Filled in by elfload.c. Simplistic, but will do for now. */
+extern struct syminfo *syminfos;
#endif /* _QEMU_DISAS_H */