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 11:36:50 +0100	[thread overview]
Message-ID: <551D1BC2.10408@imgtec.com> (raw)
In-Reply-To: <551D086D.9010604@imgtec.com>

On 02/04/2015 10:14, Leon Alrae wrote:
> On 02/04/2015 09:29, Liviu Ionescu wrote:
>>
>>> On 02 Apr 2015, at 10:56, Leon Alrae <leon.alrae@imgtec.com> wrote:
>>>
>>> ... The UHI semihosting supports Argn syscall which returns single argument,
>>> and Argn is called multiple times to build argv (each argument can
>>> contain whitespaces).
>>
>> ok, I don't want to comment too much on UHI design, since I'm not familiar with; at first sight it seems an improvement, but at second sight, from the user perspective, with your implementation, it looks overkill; all shells I know accept a single command line string, possibly with quotes if substrings need to preserve the separator spaces, and internally the shells themselves split the string into substrings and pass them to the application as (argc, argv).
> 
> How would you pass arguments containing whitespaces via
> -semihosting-config cmdline without having to reinvent shell within QEMU?

I missed the fact that you already provided the implementation for this
below... sorry. But still, the main point of arg is to keep it simple
and avoid dealing with implementing shell within QEMU. It is also
flexible, thus if a user finds it annoying to set each arg separately he
can have a wrapper responsible for parsing the command line and
translating into QEMU command line options.

Leon

> 
>>
>> in my opinion, if UHI semihosting supports single argument Argn syscalls, then it is the responsibility of the debugger (qemu in our case) to parse the command line and to provide the individual substrings in the desired format, and not ask the user to do this task manually.
> 
> Couldn't the user have a wrapper around QEMU doing it for him?
> 
> Leon
> 
>>
>> the ARM semihosting case, being more primitive in this respect, requires to run the code to split the line inside the debugged application.
>>
>> as an example, the projects generated by my GNU ARM Eclipse templates use
>>
>> https://sourceforge.net/p/micro-os-plus/iii/ci/master/tree/packages/portable/newlib.pack/src/newlib/_syscalls.c
>>
>> which, at line 419, has an __initialize_args() function.
>>
>> this is simplistic, to meet the bare metal limitations, but seems functional.
>>
>> I guess something similar, but more elaborate, can be added to qemu for UHI semihosting.
>>
>>> 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.
>>
>> from the user point of view, I still do not see the advantages of multiple arg=, it is easier to use quotes in a complete command line, like in any shell; so my vote still goes to cmdline=.
>>
>>
>> regards,
>>
>> Liviu
>>
> 

  reply	other threads:[~2015-04-02 10:37 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
2015-04-02  8:29     ` Liviu Ionescu
2015-04-02  9:14       ` Leon Alrae
2015-04-02 10:36         ` Leon Alrae [this message]
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=551D1BC2.10408@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).