aboutsummaryrefslogtreecommitdiffstats
path: root/android/main.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-12 18:45:18 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-05-14 10:13:06 +0200
commit0a879bf9ba318562e41a1bd4a6f9547f124a9831 (patch)
treeccd2d2e4e02303d3c62a73ffc4af9308e1f1e84e /android/main.c
parentbfe866d6a49a98afaf647ef912ceda47e9ec92f7 (diff)
downloadexternal_qemu-0a879bf9ba318562e41a1bd4a6f9547f124a9831.zip
external_qemu-0a879bf9ba318562e41a1bd4a6f9547f124a9831.tar.gz
external_qemu-0a879bf9ba318562e41a1bd4a6f9547f124a9831.tar.bz2
Dump hardware config. with -verbose option.
This patch dumps the content of the hardware configuration file when the -verbose option (or equivalent -debug-init) is used. This is useful to determine exactly what is launched when debugging emulator issues. Change-Id: I101b87cddb12c603b43420ea72bb357fc33f327d
Diffstat (limited to 'android/main.c')
-rw-r--r--android/main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/android/main.c b/android/main.c
index aa3ee46..37bf34a 100644
--- a/android/main.c
+++ b/android/main.c
@@ -39,6 +39,7 @@
#include "android/user-config.h"
#include "android/utils/bufprint.h"
#include "android/utils/filelock.h"
+#include "android/utils/lineinput.h"
#include "android/utils/path.h"
#include "android/utils/tempfile.h"
@@ -1089,6 +1090,25 @@ int main(int argc, char **argv)
}
args[n++] = "-android-hw";
args[n++] = strdup(coreHwIniPath);
+
+ /* In verbose mode, dump the file's content */
+ if (VERBOSE_CHECK(init)) {
+ FILE* file = fopen(coreHwIniPath, "rt");
+ if (file == NULL) {
+ derror("Could not open hardware configuration file: %s\n",
+ coreHwIniPath);
+ } else {
+ LineInput* input = lineInput_newFromStdFile(file);
+ const char* line;
+ printf("Content of hardware configuration file:\n");
+ while ((line = lineInput_getLine(input)) != NULL) {
+ printf(" %s\n", line);
+ }
+ printf(".\n");
+ lineInput_free(input);
+ fclose(file);
+ }
+ }
}
if(VERBOSE_CHECK(init)) {