blob: 17b4ce47b21d3e96f946d9ae1480f24b31308679 [file] [log] [blame]
bellardb9adb4a2003-04-29 20:41:16 +00001/* General "disassemble this chunk" code. Used for debugging. */
bellard5bbe9292003-06-09 19:38:38 +00002#include "config.h"
bellardb9adb4a2003-04-29 20:41:16 +00003#include "dis-asm.h"
bellardb9adb4a2003-04-29 20:41:16 +00004#include "elf.h"
bellardaa0aa4f2003-06-09 15:23:31 +00005#include <errno.h>
bellardb9adb4a2003-04-29 20:41:16 +00006
bellardc6105c02003-10-27 21:13:58 +00007#include "cpu.h"
8#include "exec-all.h"
bellard9307c4c2004-04-04 12:57:25 +00009#include "disas.h"
bellardc6105c02003-10-27 21:13:58 +000010
bellardb9adb4a2003-04-29 20:41:16 +000011/* Filled in by elfload.c. Simplistic, but will do for now. */
bellarde80cfcf2004-12-19 23:18:01 +000012struct syminfo *syminfos = NULL;
bellardb9adb4a2003-04-29 20:41:16 +000013
bellardaa0aa4f2003-06-09 15:23:31 +000014/* Get LENGTH bytes from info's buffer, at target address memaddr.
15 Transfer them to myaddr. */
16int
pbrook3a742b72008-10-22 15:55:18 +000017buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, int length,
18 struct disassemble_info *info)
bellardaa0aa4f2003-06-09 15:23:31 +000019{
bellardc6105c02003-10-27 21:13:58 +000020 if (memaddr < info->buffer_vma
21 || memaddr + length > info->buffer_vma + info->buffer_length)
22 /* Out of bounds. Use EIO because GDB uses it. */
23 return EIO;
24 memcpy (myaddr, info->buffer + (memaddr - info->buffer_vma), length);
25 return 0;
bellardaa0aa4f2003-06-09 15:23:31 +000026}
27
bellardc6105c02003-10-27 21:13:58 +000028/* Get LENGTH bytes from info's buffer, at target address memaddr.
29 Transfer them to myaddr. */
30static int
bellardc27004e2005-01-03 23:35:10 +000031target_read_memory (bfd_vma memaddr,
32 bfd_byte *myaddr,
33 int length,
34 struct disassemble_info *info)
bellardc6105c02003-10-27 21:13:58 +000035{
Blue Swirle612a1f2009-05-07 17:14:07 +000036 cpu_memory_rw_debug(cpu_single_env, memaddr, myaddr, length, 0);
bellardc6105c02003-10-27 21:13:58 +000037 return 0;
38}
bellardc6105c02003-10-27 21:13:58 +000039
bellardaa0aa4f2003-06-09 15:23:31 +000040/* Print an error message. We can assume that this is in response to
41 an error return from buffer_read_memory. */
42void
pbrook3a742b72008-10-22 15:55:18 +000043perror_memory (int status, bfd_vma memaddr, struct disassemble_info *info)
bellardaa0aa4f2003-06-09 15:23:31 +000044{
45 if (status != EIO)
46 /* Can't happen. */
47 (*info->fprintf_func) (info->stream, "Unknown error %d\n", status);
48 else
49 /* Actually, address between memaddr and memaddr + len was
50 out of bounds. */
51 (*info->fprintf_func) (info->stream,
bellard26a76462006-06-25 18:15:32 +000052 "Address 0x%" PRIx64 " is out of bounds.\n", memaddr);
bellardaa0aa4f2003-06-09 15:23:31 +000053}
54
55/* This could be in a separate file, to save miniscule amounts of space
56 in statically linked executables. */
57
58/* Just print the address is hex. This is included for completeness even
59 though both GDB and objdump provide their own (to print symbolic
60 addresses). */
61
62void
pbrook3a742b72008-10-22 15:55:18 +000063generic_print_address (bfd_vma addr, struct disassemble_info *info)
bellardaa0aa4f2003-06-09 15:23:31 +000064{
bellard26a76462006-06-25 18:15:32 +000065 (*info->fprintf_func) (info->stream, "0x%" PRIx64, addr);
bellardaa0aa4f2003-06-09 15:23:31 +000066}
67
68/* Just return the given address. */
69
70int
pbrook3a742b72008-10-22 15:55:18 +000071generic_symbol_at_address (bfd_vma addr, struct disassemble_info *info)
bellardaa0aa4f2003-06-09 15:23:31 +000072{
73 return 1;
74}
75
Aurelien Jarno903ec552010-03-29 02:12:51 +020076bfd_vma bfd_getl64 (const bfd_byte *addr)
77{
78 unsigned long long v;
79
80 v = (unsigned long long) addr[0];
81 v |= (unsigned long long) addr[1] << 8;
82 v |= (unsigned long long) addr[2] << 16;
83 v |= (unsigned long long) addr[3] << 24;
84 v |= (unsigned long long) addr[4] << 32;
85 v |= (unsigned long long) addr[5] << 40;
86 v |= (unsigned long long) addr[6] << 48;
87 v |= (unsigned long long) addr[7] << 56;
88 return (bfd_vma) v;
89}
90
bellardaa0aa4f2003-06-09 15:23:31 +000091bfd_vma bfd_getl32 (const bfd_byte *addr)
92{
93 unsigned long v;
94
95 v = (unsigned long) addr[0];
96 v |= (unsigned long) addr[1] << 8;
97 v |= (unsigned long) addr[2] << 16;
98 v |= (unsigned long) addr[3] << 24;
99 return (bfd_vma) v;
100}
101
102bfd_vma bfd_getb32 (const bfd_byte *addr)
103{
104 unsigned long v;
105
106 v = (unsigned long) addr[0] << 24;
107 v |= (unsigned long) addr[1] << 16;
108 v |= (unsigned long) addr[2] << 8;
109 v |= (unsigned long) addr[3];
110 return (bfd_vma) v;
111}
112
bellard6af0bf92005-07-02 14:58:51 +0000113bfd_vma bfd_getl16 (const bfd_byte *addr)
114{
115 unsigned long v;
116
117 v = (unsigned long) addr[0];
118 v |= (unsigned long) addr[1] << 8;
119 return (bfd_vma) v;
120}
121
122bfd_vma bfd_getb16 (const bfd_byte *addr)
123{
124 unsigned long v;
125
126 v = (unsigned long) addr[0] << 24;
127 v |= (unsigned long) addr[1] << 16;
128 return (bfd_vma) v;
129}
130
bellardc2d551f2005-04-27 20:15:00 +0000131#ifdef TARGET_ARM
132static int
133print_insn_thumb1(bfd_vma pc, disassemble_info *info)
134{
135 return print_insn_arm(pc | 1, info);
136}
137#endif
138
thse91c8a72007-06-03 13:35:16 +0000139/* Disassemble this for me please... (debugging). 'flags' has the following
bellardc2d551f2005-04-27 20:15:00 +0000140 values:
141 i386 - nonzero means 16 bit code
ths5fafdf22007-09-16 21:08:06 +0000142 arm - nonzero means thumb code
bellard6a00d602005-11-21 23:25:50 +0000143 ppc - nonzero means little endian
bellardc2d551f2005-04-27 20:15:00 +0000144 other targets - unused
145 */
bellard83b34f82005-01-23 20:26:30 +0000146void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
bellardb9adb4a2003-04-29 20:41:16 +0000147{
bellardc27004e2005-01-03 23:35:10 +0000148 target_ulong pc;
bellardb9adb4a2003-04-29 20:41:16 +0000149 int count;
150 struct disassemble_info disasm_info;
151 int (*print_insn)(bfd_vma pc, disassemble_info *info);
152
153 INIT_DISASSEMBLE_INFO(disasm_info, out, fprintf);
154
bellardc27004e2005-01-03 23:35:10 +0000155 disasm_info.read_memory_func = target_read_memory;
156 disasm_info.buffer_vma = code;
157 disasm_info.buffer_length = size;
158
159#ifdef TARGET_WORDS_BIGENDIAN
160 disasm_info.endian = BFD_ENDIAN_BIG;
161#else
162 disasm_info.endian = BFD_ENDIAN_LITTLE;
bellardc6105c02003-10-27 21:13:58 +0000163#endif
bellardc27004e2005-01-03 23:35:10 +0000164#if defined(TARGET_I386)
165 if (flags == 2)
166 disasm_info.mach = bfd_mach_x86_64;
ths5fafdf22007-09-16 21:08:06 +0000167 else if (flags == 1)
bellardc27004e2005-01-03 23:35:10 +0000168 disasm_info.mach = bfd_mach_i386_i8086;
169 else
170 disasm_info.mach = bfd_mach_i386_i386;
171 print_insn = print_insn_i386;
172#elif defined(TARGET_ARM)
bellardc2d551f2005-04-27 20:15:00 +0000173 if (flags)
174 print_insn = print_insn_thumb1;
175 else
176 print_insn = print_insn_arm;
bellardc27004e2005-01-03 23:35:10 +0000177#elif defined(TARGET_SPARC)
178 print_insn = print_insn_sparc;
bellard34751872005-07-02 14:31:34 +0000179#ifdef TARGET_SPARC64
180 disasm_info.mach = bfd_mach_sparc_v9b;
ths3b46e622007-09-17 08:09:54 +0000181#endif
bellardc27004e2005-01-03 23:35:10 +0000182#elif defined(TARGET_PPC)
j_mayer237c0af2007-09-29 12:01:46 +0000183 if (flags >> 16)
bellard111bfab2005-04-23 18:16:07 +0000184 disasm_info.endian = BFD_ENDIAN_LITTLE;
j_mayer237c0af2007-09-29 12:01:46 +0000185 if (flags & 0xFFFF) {
186 /* If we have a precise definitions of the instructions set, use it */
187 disasm_info.mach = flags & 0xFFFF;
188 } else {
bellarda2458622005-07-23 22:39:53 +0000189#ifdef TARGET_PPC64
j_mayer237c0af2007-09-29 12:01:46 +0000190 disasm_info.mach = bfd_mach_ppc64;
bellarda2458622005-07-23 22:39:53 +0000191#else
j_mayer237c0af2007-09-29 12:01:46 +0000192 disasm_info.mach = bfd_mach_ppc;
bellarda2458622005-07-23 22:39:53 +0000193#endif
j_mayer237c0af2007-09-29 12:01:46 +0000194 }
bellardc27004e2005-01-03 23:35:10 +0000195 print_insn = print_insn_ppc;
pbrooke6e59062006-10-22 00:18:54 +0000196#elif defined(TARGET_M68K)
197 print_insn = print_insn_m68k;
bellard6af0bf92005-07-02 14:58:51 +0000198#elif defined(TARGET_MIPS)
bellard76b30302005-12-17 01:10:04 +0000199#ifdef TARGET_WORDS_BIGENDIAN
bellard6af0bf92005-07-02 14:58:51 +0000200 print_insn = print_insn_big_mips;
bellard76b30302005-12-17 01:10:04 +0000201#else
202 print_insn = print_insn_little_mips;
203#endif
bellardfdf9b3e2006-04-27 21:07:38 +0000204#elif defined(TARGET_SH4)
205 disasm_info.mach = bfd_mach_sh4;
206 print_insn = print_insn_sh;
j_mayereddf68a2007-04-05 07:22:49 +0000207#elif defined(TARGET_ALPHA)
208 disasm_info.mach = bfd_mach_alpha;
209 print_insn = print_insn_alpha;
thsa25fd132007-10-08 12:46:58 +0000210#elif defined(TARGET_CRIS)
Edgar E. Iglesiasb09cd072011-01-10 22:31:09 +0100211 if (flags != 32) {
212 disasm_info.mach = bfd_mach_cris_v0_v10;
213 print_insn = print_insn_crisv10;
214 } else {
215 disasm_info.mach = bfd_mach_cris_v32;
216 print_insn = print_insn_crisv32;
217 }
Ulrich Hechtdb500602011-03-29 15:29:32 +0200218#elif defined(TARGET_S390X)
219 disasm_info.mach = bfd_mach_s390_64;
220 print_insn = print_insn_s390;
Edgar E. Iglesiase90e3902009-05-20 20:07:38 +0200221#elif defined(TARGET_MICROBLAZE)
222 disasm_info.mach = bfd_arch_microblaze;
223 print_insn = print_insn_microblaze;
bellardc27004e2005-01-03 23:35:10 +0000224#else
bellardb8076a72005-04-07 22:20:31 +0000225 fprintf(out, "0x" TARGET_FMT_lx
226 ": Asm output not supported on this arch\n", code);
bellardc27004e2005-01-03 23:35:10 +0000227 return;
228#endif
229
blueswir17e000c22009-02-13 21:44:41 +0000230 for (pc = code; size > 0; pc += count, size -= count) {
bellardfa15e032005-01-31 23:32:31 +0000231 fprintf(out, "0x" TARGET_FMT_lx ": ", pc);
bellardc27004e2005-01-03 23:35:10 +0000232 count = print_insn(pc, &disasm_info);
233#if 0
234 {
235 int i;
236 uint8_t b;
237 fprintf(out, " {");
238 for(i = 0; i < count; i++) {
239 target_read_memory(pc + i, &b, 1, &disasm_info);
240 fprintf(out, " %02x", b);
241 }
242 fprintf(out, " }");
243 }
244#endif
245 fprintf(out, "\n");
246 if (count < 0)
247 break;
malc754d00a2009-04-21 22:26:22 +0000248 if (size < count) {
249 fprintf(out,
250 "Disassembler disagrees with translator over instruction "
251 "decoding\n"
252 "Please report this to qemu-devel@nongnu.org\n");
253 break;
254 }
bellardc27004e2005-01-03 23:35:10 +0000255 }
256}
257
258/* Disassemble this for me please... (debugging). */
259void disas(FILE *out, void *code, unsigned long size)
260{
261 unsigned long pc;
262 int count;
263 struct disassemble_info disasm_info;
264 int (*print_insn)(bfd_vma pc, disassemble_info *info);
265
266 INIT_DISASSEMBLE_INFO(disasm_info, out, fprintf);
bellardc6105c02003-10-27 21:13:58 +0000267
bellardb9adb4a2003-04-29 20:41:16 +0000268 disasm_info.buffer = code;
269 disasm_info.buffer_vma = (unsigned long)code;
270 disasm_info.buffer_length = size;
271
Juan Quintelae2542fe2009-07-27 16:13:06 +0200272#ifdef HOST_WORDS_BIGENDIAN
bellardc27004e2005-01-03 23:35:10 +0000273 disasm_info.endian = BFD_ENDIAN_BIG;
bellardb9adb4a2003-04-29 20:41:16 +0000274#else
bellardc27004e2005-01-03 23:35:10 +0000275 disasm_info.endian = BFD_ENDIAN_LITTLE;
bellardb9adb4a2003-04-29 20:41:16 +0000276#endif
bellardbc51c5c2004-03-17 23:46:04 +0000277#if defined(__i386__)
bellardc27004e2005-01-03 23:35:10 +0000278 disasm_info.mach = bfd_mach_i386_i386;
279 print_insn = print_insn_i386;
bellardbc51c5c2004-03-17 23:46:04 +0000280#elif defined(__x86_64__)
bellardc27004e2005-01-03 23:35:10 +0000281 disasm_info.mach = bfd_mach_x86_64;
282 print_insn = print_insn_i386;
malce58ffeb2009-01-14 18:39:49 +0000283#elif defined(_ARCH_PPC)
bellardc27004e2005-01-03 23:35:10 +0000284 print_insn = print_insn_ppc;
bellarda993ba82003-05-11 12:25:45 +0000285#elif defined(__alpha__)
bellardc27004e2005-01-03 23:35:10 +0000286 print_insn = print_insn_alpha;
bellardaa0aa4f2003-06-09 15:23:31 +0000287#elif defined(__sparc__)
bellardc27004e2005-01-03 23:35:10 +0000288 print_insn = print_insn_sparc;
blueswir16ecd4532007-04-08 11:22:29 +0000289#if defined(__sparc_v8plus__) || defined(__sparc_v8plusa__) || defined(__sparc_v9__)
290 disasm_info.mach = bfd_mach_sparc_v9b;
291#endif
ths5fafdf22007-09-16 21:08:06 +0000292#elif defined(__arm__)
bellardc27004e2005-01-03 23:35:10 +0000293 print_insn = print_insn_arm;
bellard6af0bf92005-07-02 14:58:51 +0000294#elif defined(__MIPSEB__)
295 print_insn = print_insn_big_mips;
296#elif defined(__MIPSEL__)
297 print_insn = print_insn_little_mips;
bellard48024e42005-11-06 16:52:11 +0000298#elif defined(__m68k__)
299 print_insn = print_insn_m68k;
ths8f860bb2007-07-31 23:44:21 +0000300#elif defined(__s390__)
301 print_insn = print_insn_s390;
aurel32f54b3f92008-04-12 20:14:54 +0000302#elif defined(__hppa__)
303 print_insn = print_insn_hppa;
Aurelien Jarno903ec552010-03-29 02:12:51 +0200304#elif defined(__ia64__)
305 print_insn = print_insn_ia64;
bellardb9adb4a2003-04-29 20:41:16 +0000306#else
bellardb8076a72005-04-07 22:20:31 +0000307 fprintf(out, "0x%lx: Asm output not supported on this arch\n",
308 (long) code);
bellardc27004e2005-01-03 23:35:10 +0000309 return;
bellardb9adb4a2003-04-29 20:41:16 +0000310#endif
blueswir17e000c22009-02-13 21:44:41 +0000311 for (pc = (unsigned long)code; size > 0; pc += count, size -= count) {
bellardc27004e2005-01-03 23:35:10 +0000312 fprintf(out, "0x%08lx: ", pc);
bellardc27004e2005-01-03 23:35:10 +0000313 count = print_insn(pc, &disasm_info);
bellardb9adb4a2003-04-29 20:41:16 +0000314 fprintf(out, "\n");
315 if (count < 0)
316 break;
317 }
318}
319
320/* Look up symbol for debugging purpose. Returns "" if unknown. */
bellardc27004e2005-01-03 23:35:10 +0000321const char *lookup_symbol(target_ulong orig_addr)
bellardb9adb4a2003-04-29 20:41:16 +0000322{
pbrook49918a72008-10-22 15:11:31 +0000323 const char *symbol = "";
bellarde80cfcf2004-12-19 23:18:01 +0000324 struct syminfo *s;
ths3b46e622007-09-17 08:09:54 +0000325
bellarde80cfcf2004-12-19 23:18:01 +0000326 for (s = syminfos; s; s = s->next) {
pbrook49918a72008-10-22 15:11:31 +0000327 symbol = s->lookup_symbol(s, orig_addr);
328 if (symbol[0] != '\0') {
329 break;
330 }
bellardb9adb4a2003-04-29 20:41:16 +0000331 }
pbrook49918a72008-10-22 15:11:31 +0000332
333 return symbol;
bellardb9adb4a2003-04-29 20:41:16 +0000334}
bellard9307c4c2004-04-04 12:57:25 +0000335
336#if !defined(CONFIG_USER_ONLY)
337
aliguori376253e2009-03-05 23:01:23 +0000338#include "monitor.h"
bellard3d2cfdf2004-08-01 21:49:07 +0000339
bellard9307c4c2004-04-04 12:57:25 +0000340static int monitor_disas_is_physical;
bellard6a00d602005-11-21 23:25:50 +0000341static CPUState *monitor_disas_env;
bellard9307c4c2004-04-04 12:57:25 +0000342
343static int
blueswir1a5f1b962008-08-17 20:21:51 +0000344monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,
345 struct disassemble_info *info)
bellard9307c4c2004-04-04 12:57:25 +0000346{
347 if (monitor_disas_is_physical) {
348 cpu_physical_memory_rw(memaddr, myaddr, length, 0);
349 } else {
bellard6a00d602005-11-21 23:25:50 +0000350 cpu_memory_rw_debug(monitor_disas_env, memaddr,myaddr, length, 0);
bellard9307c4c2004-04-04 12:57:25 +0000351 }
352 return 0;
353}
354
Stefan Weil8b7968f2010-09-23 21:28:05 +0200355static int GCC_FMT_ATTR(2, 3)
356monitor_fprintf(FILE *stream, const char *fmt, ...)
bellard3d2cfdf2004-08-01 21:49:07 +0000357{
358 va_list ap;
359 va_start(ap, fmt);
aliguori376253e2009-03-05 23:01:23 +0000360 monitor_vprintf((Monitor *)stream, fmt, ap);
bellard3d2cfdf2004-08-01 21:49:07 +0000361 va_end(ap);
362 return 0;
363}
364
aliguori376253e2009-03-05 23:01:23 +0000365void monitor_disas(Monitor *mon, CPUState *env,
bellard6a00d602005-11-21 23:25:50 +0000366 target_ulong pc, int nb_insn, int is_physical, int flags)
bellard9307c4c2004-04-04 12:57:25 +0000367{
bellard9307c4c2004-04-04 12:57:25 +0000368 int count, i;
369 struct disassemble_info disasm_info;
370 int (*print_insn)(bfd_vma pc, disassemble_info *info);
371
aliguori376253e2009-03-05 23:01:23 +0000372 INIT_DISASSEMBLE_INFO(disasm_info, (FILE *)mon, monitor_fprintf);
bellard9307c4c2004-04-04 12:57:25 +0000373
bellard6a00d602005-11-21 23:25:50 +0000374 monitor_disas_env = env;
bellard9307c4c2004-04-04 12:57:25 +0000375 monitor_disas_is_physical = is_physical;
376 disasm_info.read_memory_func = monitor_read_memory;
377
378 disasm_info.buffer_vma = pc;
379
380#ifdef TARGET_WORDS_BIGENDIAN
381 disasm_info.endian = BFD_ENDIAN_BIG;
382#else
383 disasm_info.endian = BFD_ENDIAN_LITTLE;
384#endif
385#if defined(TARGET_I386)
bellardfa15e032005-01-31 23:32:31 +0000386 if (flags == 2)
387 disasm_info.mach = bfd_mach_x86_64;
ths5fafdf22007-09-16 21:08:06 +0000388 else if (flags == 1)
bellard9307c4c2004-04-04 12:57:25 +0000389 disasm_info.mach = bfd_mach_i386_i8086;
bellardfa15e032005-01-31 23:32:31 +0000390 else
391 disasm_info.mach = bfd_mach_i386_i386;
bellard9307c4c2004-04-04 12:57:25 +0000392 print_insn = print_insn_i386;
393#elif defined(TARGET_ARM)
394 print_insn = print_insn_arm;
thscbd669d2007-12-25 00:26:36 +0000395#elif defined(TARGET_ALPHA)
396 print_insn = print_insn_alpha;
bellard9307c4c2004-04-04 12:57:25 +0000397#elif defined(TARGET_SPARC)
398 print_insn = print_insn_sparc;
blueswir1682c4f12007-04-09 15:14:57 +0000399#ifdef TARGET_SPARC64
400 disasm_info.mach = bfd_mach_sparc_v9b;
401#endif
bellard9307c4c2004-04-04 12:57:25 +0000402#elif defined(TARGET_PPC)
bellarda2458622005-07-23 22:39:53 +0000403#ifdef TARGET_PPC64
404 disasm_info.mach = bfd_mach_ppc64;
405#else
406 disasm_info.mach = bfd_mach_ppc;
407#endif
bellard9307c4c2004-04-04 12:57:25 +0000408 print_insn = print_insn_ppc;
pbrooke6e59062006-10-22 00:18:54 +0000409#elif defined(TARGET_M68K)
410 print_insn = print_insn_m68k;
bellard6af0bf92005-07-02 14:58:51 +0000411#elif defined(TARGET_MIPS)
bellard76b30302005-12-17 01:10:04 +0000412#ifdef TARGET_WORDS_BIGENDIAN
bellard6af0bf92005-07-02 14:58:51 +0000413 print_insn = print_insn_big_mips;
bellard76b30302005-12-17 01:10:04 +0000414#else
415 print_insn = print_insn_little_mips;
416#endif
Magnus Dammb4e1f072009-11-13 18:54:22 +0900417#elif defined(TARGET_SH4)
418 disasm_info.mach = bfd_mach_sh4;
419 print_insn = print_insn_sh;
Ulrich Hechtdb500602011-03-29 15:29:32 +0200420#elif defined(TARGET_S390X)
421 disasm_info.mach = bfd_mach_s390_64;
422 print_insn = print_insn_s390;
bellard9307c4c2004-04-04 12:57:25 +0000423#else
aliguori376253e2009-03-05 23:01:23 +0000424 monitor_printf(mon, "0x" TARGET_FMT_lx
425 ": Asm output not supported on this arch\n", pc);
bellard9307c4c2004-04-04 12:57:25 +0000426 return;
427#endif
428
429 for(i = 0; i < nb_insn; i++) {
aliguori376253e2009-03-05 23:01:23 +0000430 monitor_printf(mon, "0x" TARGET_FMT_lx ": ", pc);
bellard9307c4c2004-04-04 12:57:25 +0000431 count = print_insn(pc, &disasm_info);
aliguori376253e2009-03-05 23:01:23 +0000432 monitor_printf(mon, "\n");
bellard9307c4c2004-04-04 12:57:25 +0000433 if (count < 0)
434 break;
435 pc += count;
436 }
437}
438#endif