From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9268 invoked by alias); 8 Jun 2012 14:21:19 -0000 Received: (qmail 9260 invoked by uid 22791); 8 Jun 2012 14:21:17 -0000 X-SWARE-Spam-Status: No, hits=1.2 required=5.0 tests=AWL,BAYES_20,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.23) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 08 Jun 2012 14:21:06 +0000 Received: (qmail 29537 invoked by uid 0); 8 Jun 2012 14:21:04 -0000 Received: from 46.5.56.140 by www004.gmx.net with HTTP; Fri, 08 Jun 2012 16:21:02 +0200 (CEST) Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Date: Fri, 08 Jun 2012 14:21:00 -0000 From: =?iso-8859-1?Q?=22Markus_B=FChren=22?= In-Reply-To: <1339164112.4081.ezmlm@sourceware.org> Message-ID: <20120608142102.302310@gmx.net> MIME-Version: 1.0 References: <1339164112.4081.ezmlm@sourceware.org> Subject: Quotes after --args To: gdb@sourceware.org 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/msg00047.txt.bz2 Hi, I am using the GNU gdb 6.8 under Windows. I am trying to run a program that is invoked like test.exe -f "my testfile.txt" in batch mode. This is my command line: 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. Yours Markus PS: Renaming the file is not an option - actually, I already simplified matters here to a file name with a blank in it. PPS: For your reference, this is the C code of my simple program returning the arguments: #include void main(int argc, char *argv[]) { int k; for(k = 0; k < argc; k++) { printf("argv[%d] = >>%s<<\n", k, argv[k]); } }