Sources Bugzilla – Bug 13798
regression: can't set breakpoint for filepath containing space (Error in re-setting breakpoint: Function not defined)
Last modified: 2012-06-13 18:09:03 UTC
Since gdb 7.4 setting breakpoint for a filepath containing spaces doesn't work anymore. See the following example: niko@niko-home:~$ cat space\ spaces.c #include <stdio.h> int tmp(void) { int a = 42; printf("%d", a); } int main(void) { tmp(); return 0; } #gdb 7.3.1 works fine: niko@niko-home:~$ gdb a.out GNU gdb (GDB) 7.3.1 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/niko/a.out...done. (gdb) break "space spaces.c":4 Breakpoint 1 at 0x4004ec: file space spaces.c, line 4. (gdb) r Starting program: /home/niko/a.out Breakpoint 1, tmp () at space spaces.c:4 4 int a = 42; (gdb) # gdb 7.4 doesn't: niko@niko-home:~$ gdb a.out GNU gdb (GDB) 7.4 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/niko/a.out...done. (gdb) break "space spaces.c":4 Breakpoint 1 at 0x4004ec: file space spaces.c, line 4. (gdb) r Starting program: /home/niko/a.out Error in re-setting breakpoint 1: Function "space spaces.c:4" not defined. 42[Inferior 1 (process 2008) exited normally] (gdb)
This should be fixed with the new linespec rewrite that I submitted for approval recently. Once that goes in, this should be fixed for good: (gdb) b file with spaces.cc:10 Breakpoint 1 at 0x4004e4: file file with spaces.cc, line 10.
CVSROOT: /cvs/src Module name: src Changes by: kseitz@sourceware.org 2012-06-13 18:06:07 Modified files: gdb/testsuite : ChangeLog gdb/testsuite/gdb.linespec: ls-errs.exp Log message: PR breakpoints/13798 and mi/11541 * gdb.linespec/ls-errs.exp: Add a few more tests for filenames with spaces and colons. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3223&r2=1.3224 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.linespec/ls-errs.exp.diff?cvsroot=src&r1=1.1&r2=1.2
Confirmed fixed in the linespec parser rewrite. If you plan to use filenames with spaces and/or colons in them, I highly recommend quoting them (single or double).