This was discovered while working on bug 14643. In a gdb that has bug 14643, e.g. 7.5, one should be able to work around the problem by quoting the file name. However the quotes are discarded, so while the "break" command succeeds, resetting the breakpoint, e.g. when the program is run, fails. bash$ gdb thread.c GNU gdb (GDB) 7.5 [...] (gdb) b thread-exit.c:42 malformed linespec error: unexpected keyword, "thread" (gdb) b 'thread-exit.c':42 Breakpoint 1 at 0x400a28: file thread-exit.c, line 42. (gdb) r Starting program: /home/dje/src/play/thread-exit.x64 Error in re-setting breakpoint 1: malformed linespec error: unexpected keyword, "thread" (gdb) i b Num Type Disp Enb Address What 1 breakpoint keep n 0x0000000000400a28 in main at thread-exit.c:42 If a quote was supplied when the breakpoint was set, it should not be discarded. [There is a plan to parse and save linespecs into their component pieces. Not sure when that will happen, and if we should fix this in the mean time.]
Also affects "save breakpoints": (gdb) b 'thread.c':42 Breakpoint 5 at 0x5ca5ec: file ../../src/gdb/thread.c, line 42. (gdb) info breakpoints 5 Num Type Disp Enb Address What 5 breakpoint keep y 0x00000000005ca5ec in inferior_thread at ../../src/gdb/thread.c:42 (gdb) save breakpoints foo.txt Saved to file 'foo.txt'. (gdb) shell cat foo.txt break thread.c:42
This also affects breakpoints with spaces in them. Can't be restored because of missing quotes.