aboutsummaryrefslogtreecommitdiff
path: root/disas.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-10-30 18:21:23 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-10-30 18:21:23 +0000
commitb3ecf620de718d9cc56b00d145dbd569db2c4a62 (patch)
tree6fd6e8306408e13bb90d75594ad7dbad3e0d3504 /disas.c
parenta9049a07bbeabe118c97d40e638958a946436b6f (diff)
Thumb symbol lookup (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1581 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'disas.c')
-rw-r--r--disas.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/disas.c b/disas.c
index aea8cfee44..f8d8b9eadd 100644
--- a/disas.c
+++ b/disas.c
@@ -279,6 +279,7 @@ const char *lookup_symbol(target_ulong orig_addr)
/* Hack, because we know this is x86. */
Elf32_Sym *sym;
struct syminfo *s;
+ target_ulong addr;
for (s = syminfos; s; s = s->next) {
sym = s->disas_symtab;
@@ -290,8 +291,13 @@ const char *lookup_symbol(target_ulong orig_addr)
if (ELF_ST_TYPE(sym[i].st_info) != STT_FUNC)
continue;
- if (orig_addr >= sym[i].st_value
- && orig_addr < sym[i].st_value + sym[i].st_size)
+ addr = sym[i].st_value;
+#ifdef TARGET_ARM
+ /* The bottom address bit marks a Thumb symbol. */
+ addr &= ~(target_ulong)1;
+#endif
+ if (orig_addr >= addr
+ && orig_addr < addr + sym[i].st_size)
return s->disas_strtab + sym[i].st_name;
}
}