提交 4b5dfd82 编写于 作者: P Peter Maydell 提交者: Andrzej Zaborowski

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
c235d738.)
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NAndrzej Zaborowski <andrew.zaborowski@intel.com>
上级 8534b8ba
...@@ -856,9 +856,6 @@ int main(int argc, char **argv) ...@@ -856,9 +856,6 @@ int main(int argc, char **argv)
usage(); usage();
} }
} }
if (optind >= argc)
usage();
filename = argv[optind];
/* init debug */ /* init debug */
cpu_set_log_filename(log_file); cpu_set_log_filename(log_file);
...@@ -877,6 +874,11 @@ int main(int argc, char **argv) ...@@ -877,6 +874,11 @@ int main(int argc, char **argv)
cpu_set_log(mask); cpu_set_log(mask);
} }
if (optind >= argc) {
usage();
}
filename = argv[optind];
/* Zero out regs */ /* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs)); memset(regs, 0, sizeof(struct target_pt_regs));
......
...@@ -809,9 +809,6 @@ int main(int argc, char **argv) ...@@ -809,9 +809,6 @@ int main(int argc, char **argv)
usage(); usage();
} }
} }
if (optind >= argc)
usage();
filename = argv[optind];
/* init debug */ /* init debug */
cpu_set_log_filename(log_file); cpu_set_log_filename(log_file);
...@@ -830,6 +827,11 @@ int main(int argc, char **argv) ...@@ -830,6 +827,11 @@ int main(int argc, char **argv)
cpu_set_log(mask); cpu_set_log(mask);
} }
if (optind >= argc) {
usage();
}
filename = argv[optind];
/* Zero out regs */ /* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs)); memset(regs, 0, sizeof(struct target_pt_regs));
......
...@@ -3048,11 +3048,6 @@ int main(int argc, char **argv, char **envp) ...@@ -3048,11 +3048,6 @@ int main(int argc, char **argv, char **envp)
usage(); usage();
} }
} }
if (optind >= argc)
usage();
filename = argv[optind];
exec_path = argv[optind];
/* init debug */ /* init debug */
cpu_set_log_filename(log_file); cpu_set_log_filename(log_file);
if (log_mask) { if (log_mask) {
...@@ -3070,6 +3065,12 @@ int main(int argc, char **argv, char **envp) ...@@ -3070,6 +3065,12 @@ int main(int argc, char **argv, char **envp)
cpu_set_log(mask); cpu_set_log(mask);
} }
if (optind >= argc) {
usage();
}
filename = argv[optind];
exec_path = argv[optind];
/* Zero out regs */ /* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs)); memset(regs, 0, sizeof(struct target_pt_regs));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册