@@ -36,6 +36,8 @@
#include "exec/gdbstub.h"
#include "hw/arm/arm.h"
#endif
+#include "qemu/option.h"
+#include "qemu/config-file.h"
#define TARGET_SYS_OPEN 0x01
#define TARGET_SYS_CLOSE 0x02
@@ -199,6 +201,11 @@ uint32_t do_arm_semihosting(CPUARMState *env)
#else
CPUARMState *ts = env;
#endif
+ QemuOpts *opts;
+ const char *cmdline;
+ opts = qemu_opts_find(qemu_find_opts("semihosting-config"), NULL);
+ cmdline = qemu_opt_get(opts, "cmdline");
+ printf("got cmdline %s\n", cmdline ? cmdline : "(null)");
nr = env->regs[0];
args = env->regs[1];
@@ -565,6 +565,9 @@ static QemuOptsList qemu_semihosting_config_opts = {
}, {
.name = "target",
.type = QEMU_OPT_STRING,
+ }, {
+ .name = "cmdline",
+ .type = QEMU_OPT_STRING,
},
{ /* end of list */ }
},