qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: Liviu Ionescu <ilg@livius.net>
Cc: peter.maydell@linaro.org, christopher.covington@linaro.org,
	qemu-devel@nongnu.org, matthew.fortune@imgtec.com
Subject: Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument
Date: Thu, 2 Apr 2015 08:56:19 +0100	[thread overview]
Message-ID: <551CF623.7040506@imgtec.com> (raw)
In-Reply-To: <9DE872C8-4AE3-48FC-B4A1-61ADE4DB7F32@livius.net>

On 01/04/2015 16:21, Liviu Ionescu wrote:
> 
>> On 01 Apr 2015, at 16:18, Leon Alrae <leon.alrae@imgtec.com> wrote:
>>
>> ... This simple patch adds "arg" sub-argument which in my opinion is flexible
>> enough to satisfy semi-hosting interfaces which allocate buffers at runtime
>> (so it is possible to pass any number of strings of any length) as well as the
>> ones which have limited buffer for a single input string.
> 
> I'm not sure I understand this.
> 
> the ARM semihosting interface (see below for the specs) uses a single buffer, usually of 80 bytes for embedded applications, that must be entirely allocated before the call, and in this buffer a single null terminated string is returned, assuming the buffer is large enough, otherwise -1 is returned.
> 
> what the semihosting debugger (qemu in our case) must do, is to get this string from somewhere, preferably from the command line, and pass it to the debugged application.
> 
> 
> to me, the natural implementation is to use a single string.
> 
> can you explain what are the advantages of handling multiple strings that must be later concatenated with spaces separators, to compose the full command line?
> 
> in other words, why is it better to define something like 
> 
>   "gcm --gtest_output=xml:gcm.xml --gtest_filter=FooTest.* --gtest_repeat=10" 
> 
> as 
> 
>   -semihosting-config target=native,arg="gcm",arg="--gtest_output=xml:gcm.xml",arg="--gtest_filter=FooTest.*",arg="--gtest_repeat=10"
> 
> instead of
> 
>   -semihosting-config target=native,cmdline="gcm --gtest_output=xml:gcm.xml --gtest_filter=FooTest.* --gtest_repeat=10"

The ARM semihosting supports SYS_GET_CMDLINE syscall which returns a
single string containing all arguments (whitespace separated I presume).
The UHI semihosting supports Argn syscall which returns single argument,
and Argn is called multiple times to build argv (each argument can
contain whitespaces).

I believe having just one flexible command line option in QEMU
satisfying these two cases would be ideal. But if arg doesn't suit your
needs then as Matthew already mentioned we probably should go for having
cmdline and arg mutually exclusive.

Leon

  parent reply	other threads:[~2015-04-02  7:56 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 13:18 [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument Leon Alrae
2015-04-01 15:21 ` Liviu Ionescu
2015-04-01 16:12   ` Matthew Fortune
2015-04-02  7:56   ` Leon Alrae [this message]
2015-04-02  8:29     ` Liviu Ionescu
2015-04-02  9:14       ` Leon Alrae
2015-04-02 10:36         ` Leon Alrae
2015-04-02 12:36           ` Liviu Ionescu
2015-04-02 14:27             ` Matthew Fortune
2015-04-02 16:47               ` Liviu Ionescu
2015-04-03 15:33                 ` Liviu Ionescu
2015-04-08 16:20                 ` Leon Alrae
2015-04-14 17:42                   ` Liviu Ionescu
2015-04-15  9:09                     ` Liviu Ionescu
2015-04-15 11:53                       ` Leon Alrae
2015-04-15 12:02                         ` Matthew Fortune
2015-04-15 12:06                         ` Liviu Ionescu
2015-04-15 12:49                           ` Leon Alrae
2015-04-15 16:08                             ` Liviu Ionescu
2015-04-16  9:27                               ` Leon Alrae
2015-04-17 17:45                                 ` Liviu Ionescu
2015-04-16 14:22                       ` Peter Maydell
2015-04-21 13:34                         ` Leon Alrae
2015-04-21 15:14                           ` Liviu Ionescu
2015-04-21 15:55                             ` Peter Maydell
2015-04-21 16:21                               ` Liviu Ionescu
2015-04-21 16:23                                 ` Peter Maydell
2015-04-21 16:51                                   ` Liviu Ionescu
2015-04-21 17:50                                     ` Peter Maydell
2015-04-21 16:48                               ` Eric Blake
2015-04-21 16:54                                 ` Peter Maydell
2015-04-21 17:22                                   ` Eric Blake
2015-04-21 17:49                                   ` Liviu Ionescu
2015-04-21 18:08                           ` Liviu Ionescu
2015-04-23 11:55                             ` Leon Alrae
2015-04-23 12:07                               ` Liviu Ionescu
2015-04-01 15:45 ` Christopher Covington
2015-04-01 16:24   ` Liviu Ionescu
2015-04-04 15:20 ` Liviu Ionescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551CF623.7040506@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=christopher.covington@linaro.org \
    --cc=ilg@livius.net \
    --cc=matthew.fortune@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).