From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv5eg-0006dV-DP for qemu-devel@nongnu.org; Wed, 20 May 2015 11:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv5ed-0007Hi-8E for qemu-devel@nongnu.org; Wed, 20 May 2015 11:11:34 -0400 Received: from mail-ig0-f175.google.com ([209.85.213.175]:33707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv5ed-0007Hd-4r for qemu-devel@nongnu.org; Wed, 20 May 2015 11:11:31 -0400 Received: by igbpi8 with SMTP id pi8so136514573igb.0 for ; Wed, 20 May 2015 08:11:30 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <23C7774F-9E13-488D-B796-D2BC98ECCDD9@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> <555C5460.7070600@imgtec.com> <356BB58E-2C2D-46F8-874E-2A2298289373@livius.net> <74ECF203-0CB7-46A6-80FF-6C6D0FD9AAFC@livius.net> <23C7774F-9E13-488D-B796-D2BC98ECCDD9@livius.net> From: Peter Maydell Date: Wed, 20 May 2015 16:11:10 +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 20 May 2015 at 15:59, Liviu Ionescu wrote: > >> On 20 May 2015, at 17:40, Peter Maydell wrote: >> >> ... The ARM semihosting API doesn't mandate any kind of quoting, and we >> can't know what the guest application expects, > > ok (btw, my embedded semihosting code is happy with both quotes or apostrophes) > >> so the user is going >> to have to supply any necessary quotes. > > could you exemplify how the qemu syntax would look like for passing > something functionally equivalent to the shell syntax > [program --opt1 "path 1" --opt2 "path 2"]? That depends entirely on how the guest program chooses to parse its command line string. Semihosting doesn't have any mandated quoting. So you just want to do something like --semihosting-config,arg=commandline where commandline is the command line you want the app to receive, with: * any escaping that the shell you ran QEMU via requires * the comma-escaping that QEMU's --arggroup,opt=value,opt=value syntax requires for values In the example above, assuming a POSIX-shell style quoting and that the guest splits its command line string honouring double-quotes: --semihosting-config,arg='program --opt1 "path 1" --opt2 "path 2"' UHI's API apparently passes arguments individually to the guest binary, so you would want to use multiple arg=. -- PMM