Skip to content

Commit

Permalink
Thumb symbol lookup (Paul Brook)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1581 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
bellard committed Oct 30, 2005
1 parent a9049a0 commit b3ecf62
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions disas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand Down

0 comments on commit b3ecf62

Please sign in to comment.