On 20 May 2015 at 15:59, Liviu Ionescu <i...@livius.net> wrote: > >> On 20 May 2015, at 17:40, Peter Maydell <peter.mayd...@linaro.org> wrote: >> >> ... The ARM semihosting API doesn't mandate any kind of quoting, and we >> can't know what the guest application expects, > > ok (btw, my embedded semihosting code is happy with both quotes or > apostrophes) > >> so the user is going >> to have to supply any necessary quotes. > > could you exemplify how the qemu syntax would look like for passing > something functionally equivalent to the shell syntax > [program --opt1 "path 1" --opt2 "path 2"]?
That depends entirely on how the guest program chooses to parse its command line string. Semihosting doesn't have any mandated quoting. So you just want to do something like --semihosting-config,arg=commandline where commandline is the command line you want the app to receive, with: * any escaping that the shell you ran QEMU via requires * the comma-escaping that QEMU's --arggroup,opt=value,opt=value syntax requires for values In the example above, assuming a POSIX-shell style quoting and that the guest splits its command line string honouring double-quotes: --semihosting-config,arg='program --opt1 "path 1" --opt2 "path 2"' UHI's API apparently passes arguments individually to the guest binary, so you would want to use multiple arg=. -- PMM