Skip to contentSkip to conversation

DEBUG_REMAP

PATCH New Thayne Harbaugh 1 participant 1 message Dec 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DEBUG_REMAP

This fixes a compile error for a variable that wasn't changed (it was previously renamed to make the variable more descriptive). It also adds "#include <stdlib>" for prototypes of malloc() and free().

linux-user/qemu.h +6 -1
Index: qemu/linux-user/qemu.h
===================================================================
@@ -7,6 +7,11 @@
 
 #include "cpu.h"
 
+#undef DEBUG_REMAP
+#ifdef DEBUG_REMAP
+#include <stdlib.h>
+#endif /* DEBUG_REMAP */
+
 #ifdef TARGET_ABI32
 typedef uint32_t abi_ulong;
 typedef int32_t abi_long;
@@ -374,7 +379,7 @@
     if (host_ptr == g2h(guest_addr))
         return;
     if (len > 0)
-        memcpy(g2h(guest_ptr), host_ptr, len);
+        memcpy(g2h(guest_addr), host_ptr, len);
     free(host_ptr);
 #endif
 }