Pending breakpoints on lines that don't exist

Tom Tromey
Wed Jan 4 20:42:00 GMT 2012

>>>>> "Richard" == Richard Guenther <> writes:

Richard> (gdb) b expr.c:10850
Richard> No line 10850 in file "/space/rguenther/src/svn/trunk/libcpp/expr.c".

Richard> because I meant /space/rguenther/src/svn/trunk/gcc/expr.c!  Now
Richard> getting the pending breakpoing seems to be even worse.  I'd
Richard> expect sth like

In 7.4, a linespec like "expr.c:10850" will match line 10850 in all
files named expr.c.

E.g., from the test suite:

(gdb) b
Breakpoint 1 at 0x400592: (2 locations)
(gdb) info b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>         
1.1                         y     0x0000000000400592 in n(int) 
                                                   at ../../../archer/gdb/testsuite/gdb.linespec/base/two/
1.2                         y     0x0000000000400556 in m(int) 
                                                   at ../../../archer/gdb/testsuite/gdb.linespec/base/one/

This breakpoint got locations in two different files, both named ''.

The rationale behind this is that gdb should not guess what you meant.

The right thing also happens if one "" has the indicated line
but the other does not.

Richard> it's especially bad that gdb does not recognize
Richard> (gdb) b gcc/expr.c:10850
Richard> but requires a full path (bah).

Yeah, this is still a problem.  I intend to fix it at some point, but
it is too late for 7.4.

I think what makes sense here is to just do the obvious check of the
user-supplied name against the final components of the file names.


More information about the Gdb mailing list