On 17 November 2014 12:32, Peter Maydell <peter.mayd...@linaro.org> wrote: > This (the extra command line option to specify where semihosting > should go) is definitely a feature we should add. I think it's > possible to make use of the QemuOpts infrastructure to support > -semihosting # current option name with existing semantics > -semihosting target=gdb > -semihosting target=native > -semihosting target=auto # same as plain "-semihosting"
...and then my mail client sent that mail half-composed. The missing fragment: > something like (untested): > static QemuOptsList qemu_semihosting_opts = { > .name = "semihosting", > .implied_opt_name = "enable", > .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_opts.head), > .desc = { > { > .name = "enable", > .type = QEMU_OPT_BOOL, > },{ > .name = "target", > .type = QEMU_OPT_STRING, > } > { /* end of list */ } > }, > }; [and if you don't specify target then we default to 'auto'.] Compare the handling of 'rtc' and similar options: you get to have an "implied option name" so "-foo" is treated like "-foo enable=true", which gives us backwards compatibility with our existing option, and a syntax for specifying the target that fits in with the other command line options we already have. thanks -- PMM