qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config ar


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument
Date: Wed, 20 May 2015 16:11:10 +0100

On 20 May 2015 at 15:59, Liviu Ionescu <address@hidden> wrote:
>
>> On 20 May 2015, at 17:40, Peter Maydell <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]