]> git.proxmox.com Git - qemu.git/commitdiff
Fix disassembler memory accesses
authorBlue Swirl <blauwirbel@gmail.com>
Thu, 7 May 2009 17:14:07 +0000 (17:14 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Thu, 7 May 2009 17:14:07 +0000 (17:14 +0000)
Sparc disassembler wants to check previous addresses for some stuff
and this may actually cause faults to be generated to the guest if the
address is close to page start, because of the function used for the
memory access.

Fix by changing ldub_code to cpu_memory_rw_debug, which doesn't trigger
exceptions.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
disas.c

diff --git a/disas.c b/disas.c
index 37f7433c3b5095fda0951591bd2d5d1808c181d3..6ed31e3b79fe4e3b3eb366a15fc954810bcb5a6e 100644 (file)
--- a/disas.c
+++ b/disas.c
@@ -33,10 +33,7 @@ target_read_memory (bfd_vma memaddr,
                     int length,
                     struct disassemble_info *info)
 {
-    int i;
-    for(i = 0; i < length; i++) {
-        myaddr[i] = ldub_code(memaddr + i);
-    }
+    cpu_memory_rw_debug(cpu_single_env, memaddr, myaddr, length, 0);
     return 0;
 }