From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10796 invoked by alias); 10 Aug 2006 12:58:33 -0000 Received: (qmail 10788 invoked by uid 22791); 10 Aug 2006 12:58:32 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 10 Aug 2006 12:58:30 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GBA7I-0004ml-1D; Thu, 10 Aug 2006 08:58:28 -0400 Date: Thu, 10 Aug 2006 12:58:00 -0000 From: Daniel Jacobowitz To: Nikolay Molchanov Cc: gdb@sourceware.org Subject: Re: How to set a breakpoint in file, which name has spaces? Message-ID: <20060810125827.GA18306@nevyn.them.org> Mail-Followup-To: Nikolay Molchanov , gdb@sourceware.org References: <44D832EE.2040405@sun.com> <44D8E404.5050407@Sun.COM> <44D98D66.9060202@sun.com> <44DAD087.30004@sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44DAD087.30004@sun.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00084.txt.bz2 On Wed, Aug 09, 2006 at 11:21:59PM -0700, Nikolay Molchanov wrote: > Hello! > > There seems to be a problem with setting a breakpoint in files, > which names have spaces (usually it happens on Windows, but it > is possible to create such files in Unix filesystems as well). > > Here is a part of a log file, that shows the problem. > Note that '\ ' works just great in "-file-exec-and-symbols" command, > but does not work in "-break-insert" command. Quoting in the MI interface is generally inconsistent. If you care, you can find a somewhat more detailed summary of the problems in the archives a few months ago. > 221-break-insert C:/Documents\ and\ > Settings/nikm/.netbeans/Netbeans\ Projects/Args1/src/main.c:17 > &"mi_cmd_break_insert: Garbage following \n" > 221^error,msg="mi_cmd_break_insert: Garbage following " > (gdb) > > I tried to use single and double quotes, but still no luck. > Is it a known problem? Is there a workaround? Let's see. For current versions of GDB, -break-insert is parsed as a true MI command, which means it passes through the MI quoting rules. That's described in the GDB manual (GDB/MI Input Syntax). It says that single quotes and backslashes aren't special, only double quotes, and within double quotes things are treated as a C string. Then, after that escaping, it is passed to the normal breakpoint code. So if you want to simulate: break 'C:/Documents and Settings/foo.c':17 You'd need -break-insert "'C:/Documents and Settings/foo.c':17" This is actually more or less how things are supposed to work. -- Daniel Jacobowitz CodeSourcery