qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-arg


From: Liviu Ionescu
Subject: Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument
Date: Wed, 15 Apr 2015 12:09:33 +0300

Peter/Leon,

I'm planning for my future releases, and, to avoid incompatible versions, I 
would like to help with the semihosting configuration issue, to speed up 
things. is there any chance to close this issue in the near future?

we currently have two solutions:

- multiple: --semihosting-config arg="..." 
- a single option, placed at the end, and followed by any number of arguments: 
--semihosting-cmdline $@ \n

both can generate the array of args required by UHI and both can pass args with 
spaces.

the second one is more scripting friendly, and is somehow in the spirit of 
other unix programs that need to pass such arguments.

please let me know how can I be of any help.


regards,

Liviu



> On 14 Apr 2015, at 20:42, Liviu Ionescu <address@hidden> wrote:
> 
> 
>> On 08 Apr 2015, at 19:20, Leon Alrae <address@hidden> wrote:
>> 
>> ... I do understand
>> however that in your particular case cmdline is more convenient, thus I
>> personally don’t mind having both options: the user-friendly cmdline and
>> more flexible arg.
> 
> I was a bit optimistic with the first implementation of 
> "--semihosting-cmdline string", since this approach complicates things when 
> calling the emulator from a script.
> 
> a normal script might do something like
> 
> ~~~
> # identify own args and use shift to 'eat' them
> exec qemu ... --semihosting-cmdline $@
> ~~~
> 
> the first thought was to transform the $@ array into a single string with 
> quotes, like "$@", but this does not work properly if the arguments already 
> include spaces.
> 
> so, after long considerations, I had to revert to the very first idea, to use 
> a variable number args option, which, obviously, cannot be placed anywhere 
> else but at the end.
> 
> the new implementation is available from:
> 
>  https://sourceforge.net/p/gnuarmeclipse/qemu/ci/gnuarmeclipse-dev/tree/vl.c
> 
> the option is identified in the first parsing loop, args are stored and argc 
> is diminished accordingly, for the second pass to work without any changes.
> 
> one more thing to note is the concatenate_semihosting_cmdline() function, 
> which is not as simple as Leon suggested in the original post, since it has 
> to add quotes to arguments containing spaces.
> 
> I updated the Eclipse plug-in to use this mechanism and there were no 
> problems. passing the args from a script is also pretty easy, so to me this 
> looks like the right solution.
> 
> 
> any comments?
> 
> 
> Livius
> 
> 
> 
> 
> 




reply via email to

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