aboutsummaryrefslogtreecommitdiffstats
path: root/disas.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-13 21:44:41 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-13 21:44:41 +0000
commit7e000c2e3d0ace8912e677c698ee7eb17919832a (patch)
tree0e0202d2d47646071fa4858041bb5f5f21a95b15 /disas.c
parent176050719287eb73f6ff8610843cbcbbb0ae388b (diff)
Allow disassembling last addresses of the address space
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6619 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'disas.c')
-rw-r--r--disas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disas.c b/disas.c
index 83c8826b4..a8cd11cd8 100644
--- a/disas.c
+++ b/disas.c
@@ -204,7 +204,7 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
return;
#endif
- for (pc = code; pc < code + size; pc += count) {
+ for (pc = code; size > 0; pc += count, size -= count) {
fprintf(out, "0x" TARGET_FMT_lx ": ", pc);
count = print_insn(pc, &disasm_info);
#if 0
@@ -276,7 +276,7 @@ void disas(FILE *out, void *code, unsigned long size)
(long) code);
return;
#endif
- for (pc = (unsigned long)code; pc < (unsigned long)code + size; pc += count) {
+ for (pc = (unsigned long)code; size > 0; pc += count, size -= count) {
fprintf(out, "0x%08lx: ", pc);
#ifdef __arm__
/* since data is included in the code, it is better to