From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57750 invoked by alias); 21 Jan 2019 10:19:36 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 56650 invoked by uid 89); 21 Jan 2019 10:19:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_05,SPF_PASS autolearn=ham version=3.3.2 spammy=gmt, GMT, H*f:sk:CABrM6w, H*i:sk:CABrM6w X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Jan 2019 10:19:33 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glWfz-0004Mv-10; Mon, 21 Jan 2019 05:19:31 -0500 Received: from [176.13.6.54] (port=8225 helo=[10.130.42.54]) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1glWfu-0002Tx-Ex; Mon, 21 Jan 2019 05:19:30 -0500 Date: Mon, 21 Jan 2019 10:19:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: can't handle command-line argument containing whitespace To: gdb@sourceware.org,Peng Yu ,"gdb@sourceware.org" From: Eli Zaretskii Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00015.txt.bz2 On January 21, 2019 6:50:25 AM GMT+02:00, Peng Yu wro= te: > Hi, >=20 > I got the following error. Is there a way to allow gdb accept > arguments with whitespaces? Thanks >=20 > $ ./main.exe 'a b c' > a b c > $ cat main.c > /* vim: set noexpandtab tabstop=3D2: */ > #include >=20 > int main(int argc, char *argv[]) { > puts(argv[1]); > return 0; > } > $ gdb -q --args main.exe 'a b c' > Reading symbols from main.exe...(no debugging symbols found)...done. > (gdb) r > Starting program: /root/linux/test/gnu/gdb/bin/--args/main.exe can't > handle command-line argument containing whitespace > (gdb) Try this GDB command: (gdb) set startup-with-shell on