Commit c2d551ff5acc0e236fe7fd8dfb1ce290d9ff4d99
1 parent
192c7bd9
ARM thumb disassembly (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1416 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
23 additions
and
3 deletions
arm-dis.c
disas.c
| ... | ... | @@ -108,8 +108,20 @@ bfd_vma bfd_getb32 (const bfd_byte *addr) |
| 108 | 108 | return (bfd_vma) v; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | -/* Disassemble this for me please... (debugging). 'flags' is only used | |
| 112 | - for i386: non zero means 16 bit code */ | |
| 111 | +#ifdef TARGET_ARM | |
| 112 | +static int | |
| 113 | +print_insn_thumb1(bfd_vma pc, disassemble_info *info) | |
| 114 | +{ | |
| 115 | + return print_insn_arm(pc | 1, info); | |
| 116 | +} | |
| 117 | +#endif | |
| 118 | + | |
| 119 | +/* Disassemble this for me please... (debugging). 'flags' has teh following | |
| 120 | + values: | |
| 121 | + i386 - nonzero means 16 bit code | |
| 122 | + arm - nonzero means thumb code | |
| 123 | + other targets - unused | |
| 124 | + */ | |
| 113 | 125 | void target_disas(FILE *out, target_ulong code, target_ulong size, int flags) |
| 114 | 126 | { |
| 115 | 127 | target_ulong pc; |
| ... | ... | @@ -137,7 +149,10 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags) |
| 137 | 149 | disasm_info.mach = bfd_mach_i386_i386; |
| 138 | 150 | print_insn = print_insn_i386; |
| 139 | 151 | #elif defined(TARGET_ARM) |
| 140 | - print_insn = print_insn_arm; | |
| 152 | + if (flags) | |
| 153 | + print_insn = print_insn_thumb1; | |
| 154 | + else | |
| 155 | + print_insn = print_insn_arm; | |
| 141 | 156 | #elif defined(TARGET_SPARC) |
| 142 | 157 | print_insn = print_insn_sparc; |
| 143 | 158 | #elif defined(TARGET_PPC) | ... | ... |