From: Nikolay Molchanov <Nikolay.Molchanov@Sun.COM>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sourceware.org
Subject: Re: How to set a breakpoint in file, which name has spaces?
Date: Thu, 10 Aug 2006 16:36:00 -0000 [thread overview]
Message-ID: <44DB6093.4030905@sun.com> (raw)
In-Reply-To: <20060810125827.GA18306@nevyn.them.org>
Daniel,
>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.
>
>
I would be happy to take a look at the discussion.
IMHO a good solution is to use '\ ' to escape spaces. It is standard
Unix approach.
The real '\' character should be passed as double '\' ("\\").
What is nice, it works just great in "-file-exec-and-symbols" command,
so it seems
a pretty straight forward solution to make other commands consistent
with this one.
>
>
>>221-break-insert C:/Documents\ and\
>>Settings/nikm/.netbeans/Netbeans\ Projects/Args1/src/main.c:17
>>&"mi_cmd_break_insert: Garbage following <location>\n"
>>221^error,msg="mi_cmd_break_insert: Garbage following <location>"
>>(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
>
>
Unfortunately this does not work:
break 'C:/Documents and Settings/nikm/.netbeans/Netbeans
Projects/Args1/src/main.c':17
&"break 'C:/Documents and Settings/nikm/.netbeans/Netbeans
Projects/Args1/src/main.c':17\n"
&"Function \"C:/Documents and Settings/nikm/.netbeans/Netbeans
Projects/Args1/src/main.c\" not defined.\n"
~"Breakpoint 3 ('C:/Documents and Settings/nikm/.netbeans/Netbeans
Projects/Args1/src/main.c':17) pending.\n"
^done
(gdb)
>You'd need
> -break-insert "'C:/Documents and Settings/foo.c':17"
>
>This is actually more or less how things are supposed to work.
>
>
And this one also does not work:
221-break-insert "'C:/Documents and Settings/nikm/.netbeans/Netbeans
Projects/Args1/src/main.c':17"
&"Function \"C:/Documents and Settings/nikm/.netbeans/Netbeans
Projects/Args1/src/main.c\" not defined.\n"
221^done
(gdb)
next prev parent reply other threads:[~2006-08-10 16:36 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-08 6:45 Why gdb 6.5 prints fullname in /cygdrive/... format om Windows? Nikolay Molchanov
2006-08-08 10:36 ` Nick Roberts
2006-08-08 13:18 ` Daniel Jacobowitz
2006-08-08 15:29 ` Christopher Faylor
2006-08-08 17:31 ` Bob Rossi
2006-08-08 17:36 ` Joel Brobecker
2006-08-08 19:24 ` Why gdb 6.5 prints fullname in /cygdrive/... format on Windows? Nikolay Molchanov
2006-08-08 19:27 ` Daniel Jacobowitz
2006-08-08 20:01 ` Joel Brobecker
2006-08-08 20:17 ` Pedro Alves
2006-08-08 21:07 ` Christopher Faylor
2006-08-08 17:36 ` Why gdb 6.5 prints fullname in /cygdrive/... format om Windows? Daniel Jacobowitz
2006-08-09 9:17 ` Andrew STUBBS
2006-08-09 13:42 ` Daniel Jacobowitz
2006-08-09 14:38 ` Christopher Faylor
2006-08-09 18:10 ` Bob Rossi
2006-08-09 18:12 ` Daniel Jacobowitz
2006-08-09 18:18 ` Joel Brobecker
2006-08-09 18:23 ` Bob Rossi
2006-08-09 21:28 ` Christopher Faylor
2006-08-08 18:53 ` Eli Zaretskii
2006-08-08 19:33 ` Nikolay Molchanov
[not found] ` <44D8E404.5050407@Sun.COM>
2006-08-08 21:31 ` Eli Zaretskii
2006-08-09 7:23 ` Nikolay Molchanov
2006-08-09 8:41 ` Pedro Alves
2006-08-09 16:49 ` Why gdb 6.5 prints fullname in /cygdrive/... format on Windows? Nikolay Molchanov
2006-08-09 17:40 ` Why gdb 6.5 prints fullname in /cygdrive/... format om Windows? Eli Zaretskii
2006-08-10 6:22 ` How to set a breakpoint in file, which name has spaces? Nikolay Molchanov
2006-08-10 12:58 ` Daniel Jacobowitz
2006-08-10 16:36 ` Nikolay Molchanov [this message]
2006-08-10 17:51 ` Daniel Jacobowitz
2006-08-11 5:27 ` Nikolay Molchanov
2006-08-11 12:55 ` Eli Zaretskii
2006-08-11 13:48 ` Daniel Jacobowitz
2006-08-11 16:17 ` Eli Zaretskii
2006-08-11 20:13 ` Joel Brobecker
2006-08-13 18:02 ` Daniel Jacobowitz
2006-08-13 20:33 ` Joel Brobecker
2006-08-12 11:44 ` Mark Kettenis
2006-08-12 12:31 ` Andreas Schwab
2006-08-12 14:22 ` Mark Kettenis
2006-08-12 14:20 ` Eli Zaretskii
2006-08-12 14:46 ` Mark Kettenis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44DB6093.4030905@sun.com \
--to=nikolay.molchanov@sun.com \
--cc=drow@false.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox