From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTlw-0005cK-UN for qemu-devel@nongnu.org; Thu, 21 May 2015 12:56:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvTlu-0000Db-8w for qemu-devel@nongnu.org; Thu, 21 May 2015 12:56:40 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:34922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTlu-0000Cx-5a for qemu-devel@nongnu.org; Thu, 21 May 2015 12:56:38 -0400 Received: by iesa3 with SMTP id a3so12881362ies.2 for ; Thu, 21 May 2015 09:56:37 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <830D1EDC-E900-4A13-862B-20547654F1E3@livius.net> References: <1431085311-24617-1-git-send-email-leon.alrae@imgtec.com> <1431085311-24617-3-git-send-email-leon.alrae@imgtec.com> <555C41BF.3070900@imgtec.com> <555DE45B.4030101@imgtec.com> <3F8E8763-93C1-4027-A7E3-888BCDEE96BE@livius.net> <078E10E9-9879-4EB6-8D09-AADB88EAACAB@livius.net> <7201FC78-04E3-42CB-B004-B21D48580C88@livius.net> <830D1EDC-E900-4A13-862B-20547654F1E3@livius.net> From: Peter Maydell Date: Thu, 21 May 2015 17:56:17 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liviu Ionescu Cc: Christopher Covington , Leon Alrae , QEMU Developers , Matthew Fortune On 21 May 2015 at 17:36, Liviu Ionescu wrote: > >> On 21 May 2015, at 18:54, Peter Maydell wrote: >> >> On 21 May 2015 at 16:47, Liviu Ionescu wrote: >>> >>>> On 21 May 2015, at 18:29, Peter Maydell wrote: >>>> >>>> >>>> There's no way to not offer the choice. In your syntax >>>> this would be >>>> --semihosting-cmdline "foo bar baz" >>> >>> not exactly. in my implementation this would arrive in the guest >>> code as argc=1, argv[0]="foo bar baz", which will be understood as >>> a weird program name. >> >> Well, it's the same as --semihosting-options,arg="foo bar baz". >> That will arrive in the guest code as "foo bar baz", which >> the guest code may or may not choose to interpret as a >> program name foo and two arguments. > > negative. > > your example: > > ... --semihosting-options,arg="foo bar baz" ... > > will arrive in the guest code as: > > ['f' 'o' 'o' ' ' 'b' 'a' 'r' ' ' 'b' 'a' 'z'] > > which any non-brain damaged parser should understand as: > > argc=3, argv[0]="foo", argv[1]="bar", argv[2]="baz" > > while in my implementation a command line like: > > ... --semihosting-cmdline "foo bar baz" CR > > will arrive as: > > ['"' 'f' 'o' 'o' ' ' 'b' 'a' 'r' ' ' 'b' 'a' 'z' '"'] That's because your code is adding quotes, which I've already said I think is incorrect. If you took out the addition of quotes the two would be the same. -- PMM