From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31497 invoked by alias); 20 Oct 2012 16:30:29 -0000 Received: (qmail 31456 invoked by uid 22791); 20 Oct 2012 16:30:25 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 20 Oct 2012 16:29:49 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4E52A1C7DAA; Sat, 20 Oct 2012 12:29:49 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LQ2-WF94RyXw; Sat, 20 Oct 2012 12:29:49 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1C4FB2E0BE; Sat, 20 Oct 2012 12:29:49 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 59831C49FB; Sat, 20 Oct 2012 09:29:36 -0700 (PDT) Date: Sat, 20 Oct 2012 16:30:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [RFA/commit/Windows] run program with space in path to exe. Message-ID: <20121020162936.GC3050@adacore.com> References: <1350692925-14181-1-git-send-email-brobecker@adacore.com> <83happzi44.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83happzi44.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00368.txt.bz2 > Does it work if you say > > % gdb "\"c:\path to exe\foo.exe\"" > > instead? It doesn't, because GDB thinks that the name of the executable includes those quotes. > This is impossible, at least in the MinGW case: Windows file names > cannot include the quote character. See > > http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx OK, great. I wasn't sure whether this was allowed or not. I was able to create a file with a double-quote, but that was under cygwin. > But what happens if the program name is already quoted? A user can do > that if she realizes the problem in advance, certainly if the program > name is specified at the GDB prompt, as in 'file "c:\foo bar\my.exe"'. > I think we should detect this case and not quote it again. As per the above - this time, it's GDB that punts, so we never even get to the point where we can run the program. > Also, what about the arguments to the program? Don't they have the > same issue when you use --args on the GDB command line? The arguments are always quoted properly by the generic portion of GDB. No problem there. -- Joel