summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-07-30 13:18:35 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-04 16:19:04 -0500
commit01825a8ddf2f269407905d67993d73abab6e2177 (patch)
treea06051aa39c3c2bbe96c471a372ffd8537e18a21
parentlm32: softusb: claim to support full speed (diff)
downloadqemu-kvm-01825a8ddf2f269407905d67993d73abab6e2177.tar.gz
qemu-kvm-01825a8ddf2f269407905d67993d73abab6e2177.tar.bz2
qemu-kvm-01825a8ddf2f269407905d67993d73abab6e2177.zip
user: Restore debug usage message for '-d ?' in user mode emulation
The code which prints the debug usage message on '-d ?' for *-user has to come before the check for "not enough arguments", so that "qemu-foo -d ?" prints the list of possible debug log items rather than the generic usage message. (This was inadvertently broken in commit c235d73.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--bsd-user/main.c8
-rw-r--r--darwin-user/main.c8
-rw-r--r--linux-user/main.c11
3 files changed, 16 insertions, 11 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 6018a419e..a63b8777f 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -856,9 +856,6 @@ int main(int argc, char **argv)
usage();
}
}
- if (optind >= argc)
- usage();
- filename = argv[optind];
/* init debug */
cpu_set_log_filename(log_file);
@@ -877,6 +874,11 @@ int main(int argc, char **argv)
cpu_set_log(mask);
}
+ if (optind >= argc) {
+ usage();
+ }
+ filename = argv[optind];
+
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));
diff --git a/darwin-user/main.c b/darwin-user/main.c
index 35196a12c..72307adeb 100644
--- a/darwin-user/main.c
+++ b/darwin-user/main.c
@@ -809,9 +809,6 @@ int main(int argc, char **argv)
usage();
}
}
- if (optind >= argc)
- usage();
- filename = argv[optind];
/* init debug */
cpu_set_log_filename(log_file);
@@ -830,6 +827,11 @@ int main(int argc, char **argv)
cpu_set_log(mask);
}
+ if (optind >= argc) {
+ usage();
+ }
+ filename = argv[optind];
+
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));
diff --git a/linux-user/main.c b/linux-user/main.c
index 2135b9c71..6a8f4bdc1 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3048,11 +3048,6 @@ int main(int argc, char **argv, char **envp)
usage();
}
}
- if (optind >= argc)
- usage();
- filename = argv[optind];
- exec_path = argv[optind];
-
/* init debug */
cpu_set_log_filename(log_file);
if (log_mask) {
@@ -3070,6 +3065,12 @@ int main(int argc, char **argv, char **envp)
cpu_set_log(mask);
}
+ if (optind >= argc) {
+ usage();
+ }
+ filename = argv[optind];
+ exec_path = argv[optind];
+
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));