aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2010-08-09 13:33:57 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2010-08-09 13:33:57 -0700
commitb5365f32d7b1dcc6c3e9be7584ce8d4f68b3e7e1 (patch)
tree16b50a07212fa0d4a08ea28e361701aa0cb17732
parent074d1f955a15c19214cee92c627c8c4697e98cd3 (diff)
downloadexternal_qemu-b5365f32d7b1dcc6c3e9be7584ce8d4f68b3e7e1.zip
external_qemu-b5365f32d7b1dcc6c3e9be7584ce8d4f68b3e7e1.tar.gz
external_qemu-b5365f32d7b1dcc6c3e9be7584ce8d4f68b3e7e1.tar.bz2
Move memchecker initialization from main.c to vl-android.c (core)
Also move qemu-malloc.c to common CORE and UI sources Change-Id: Ifd62ae247cc03700d85b5fc35072d73ac37cc570
-rw-r--r--Makefile.android2
-rw-r--r--android/main.c14
-rw-r--r--qemu-options.hx3
-rw-r--r--vl-android.c18
4 files changed, 27 insertions, 10 deletions
diff --git a/Makefile.android b/Makefile.android
index 779653c..a5e5de3 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -640,7 +640,6 @@ CORE_MISC_SOURCES = vl-android.c \
shaper.c \
charpipe.c \
tcpdump.c \
- qemu-malloc.c \
qemu-option.c \
savevm.c \
net-android.c \
@@ -719,6 +718,7 @@ UI_AND_CORE_SOURCES = osdep.c \
cutils.c \
sockets.c \
keymaps.c \
+ qemu-malloc.c \
android/keycode-array.c \
android/charmap.c \
android/hw-qemud.c \
diff --git a/android/main.c b/android/main.c
index 99720f5..2eba00f 100644
--- a/android/main.c
+++ b/android/main.c
@@ -62,9 +62,6 @@
#include "android/cmdline-option.h"
#include "android/help.h"
#include "hw/goldfish_nand.h"
-#ifdef CONFIG_MEMCHECK
-#include "memcheck/memcheck.h"
-#endif // CONFIG_MEMCHECK
#include "android/globals.h"
#include "tcpdump.h"
@@ -1395,12 +1392,6 @@ int main(int argc, char **argv)
opts->trace = tracePath;
}
-#ifdef CONFIG_MEMCHECK
- if (opts->memcheck) {
- memcheck_init(opts->memcheck);
- }
-#endif // CONFIG_MEMCHECK
-
if (opts->tcpdump) {
if (qemu_tcpdump_start(opts->tcpdump) < 0) {
dwarning( "could not start packet capture: %s", strerror(errno));
@@ -1873,6 +1864,11 @@ int main(int argc, char **argv)
args[n++] = opts->charmap;
}
+ if (opts->memcheck) {
+ args[n++] = "-android-memcheck";
+ args[n++] = opts->memcheck;
+ }
+
/* physical memory */
args[n++] = "-m";
args[n++] = opts->memory;
diff --git a/qemu-options.hx b/qemu-options.hx
index 03e3be2..1883b08 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1630,4 +1630,7 @@ DEF("android-gui", HAS_ARG, QEMU_OPTION_android_gui, \
DEF("android-hw", HAS_ARG, QEMU_OPTION_android_hw, \
"-android-hw <file> read hardware initialization from ini file\n")
+DEF("android-memcheck", HAS_ARG, QEMU_OPTION_android_memcheck, \
+ "-android-memcheck <options> enable memory access checking on the emulated system\n")
+
#endif
diff --git a/vl-android.c b/vl-android.c
index fa32b79..12627fd 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -57,6 +57,10 @@
#include "android/globals.h"
#include "targphys.h"
+#ifdef CONFIG_MEMCHECK
+#include "memcheck/memcheck.h"
+#endif // CONFIG_MEMCHECK
+
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
@@ -344,6 +348,9 @@ char* android_op_gui = NULL;
/* Path to hardware initialization file passed with -android-hw option. */
char* android_op_hwini = NULL;
+/* Memory checker options. */
+char* android_op_memcheck = NULL;
+
extern int android_display_width;
extern int android_display_height;
extern int android_display_bpp;
@@ -5813,6 +5820,11 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_android_hw:
android_op_hwini = (char*)optarg;
break;
+#ifdef CONFIG_MEMCHECK
+ case QEMU_OPTION_android_memcheck:
+ android_op_memcheck = (char*)optarg;
+ break;
+#endif // CONFIG_MEMCHECK
}
}
}
@@ -5856,6 +5868,12 @@ int main(int argc, char **argv, char **envp)
iniFile_free(hw_ini);
#endif // CONFIG_STANDALONE_CORE
+#ifdef CONFIG_MEMCHECK
+ if (android_op_memcheck) {
+ memcheck_init(android_op_memcheck);
+ }
+#endif // CONFIG_MEMCHECK
+
#if defined(CONFIG_KVM) && defined(CONFIG_KQEMU)
if (kvm_allowed && kqemu_allowed) {
fprintf(stderr,