[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: |
Tue, 14 Apr 2015 20:42:21 +0300 |
> 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
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, (continued)
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Matthew Fortune, 2015/04/01
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Matthew Fortune, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/02
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/03
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/08
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument,
Liviu Ionescu <=
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Matthew Fortune, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/16
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/17
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Peter Maydell, 2015/04/16
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/21