From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9946 invoked by alias); 8 Jun 2012 14:50:23 -0000 Received: (qmail 9934 invoked by uid 22791); 8 Jun 2012 14:50:20 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jun 2012 14:50:07 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M5A00900ZP0QP00@a-mtaout23.012.net.il> for gdb@sourceware.org; Fri, 08 Jun 2012 17:50:06 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M5A009SZZVHLG70@a-mtaout23.012.net.il>; Fri, 08 Jun 2012 17:50:06 +0300 (IDT) Date: Fri, 08 Jun 2012 14:50:00 -0000 From: Eli Zaretskii Subject: Re: Quotes after --args In-reply-to: <20120608142102.302310@gmx.net> To: =?utf-8?Q?Markus_B=C3=BChren?= Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <833965voww.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT References: <1339164112.4081.ezmlm@sourceware.org> <20120608142102.302310@gmx.net> X-IsSubscribed: yes 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 X-SW-Source: 2012-06/txt/msg00048.txt.bz2 > Date: Fri, 08 Jun 2012 16:21:02 +0200 > From: "Markus Bühren" > > gdb --eval-command=run --batch --args test.exe -f "my testfile.txt" > > My program should get two arguments, '-f' and 'my testfile.txt'. However, replacing my actual program test.exe by a program that just prints the input arguments, I get the following result: > > C:\>gdb --eval-command=run --batch --args test.exe -f "my testfile.txt" > [New thread 6180.0xad0] > argv[0] = >>C:/test.exe<< > argv[1] = >>-f<< > argv[2] = >>my\<< > argv[3] = >>testfile.txt<< > > Program exited normally. > > Can you help me to avoid that the file name is splitted into two arguments, with replacing the blank ' ' after 'my' by a backslash '\'? I have tried a lot of combinations of double double quotes '""', escaped double quotes '\"' and so on but I did not manage to get the file name passed as a single argument into my program. It's a bug. GDB handles the whitespace in a way that works on Posix platforms, but not on Windows. > PS: Renaming the file is not an option - actually, I already simplified matters here to a file name with a blank in it. You can always use its 8+3 alias, something like mytest~1.txt (use the "dir /x" command from the shell prompt to see the actual name), instead of the long name. This is a workaround, though.