[RFC] multiple breakpoints from FILE:LINE

Paul Hilfinger
2006-01-13T10:42:16Z

In response to

break FUNCTION

in C++, GDB currently presents one with a list of choices when FUNCTION
is overloaded. However, this is not the only case in which the target
of a 'break' command is ambiguous. Consider

break FILENAME:LINENUM

Normally, this refers to a single location in a program, but if this line
is in the middle of a C++ template, a multiply #included file, or an
Ada generic definition, it may refer to several locations. Currently,
GDB chooses one of these silently.

In Ada mode, AdaCore's GNAT Pro version of GDB will also present a menu in
response to this latter case. In addition, we introduced a syntax
(little used, I believe) for specifying a line in one specific generic
instance:

break FILENAME:FUNCTION:LINENUM

where FUNCTION here would be fully qualified. That is, if P1 and P2
are two different instantiations of a generic class defining F, then

break something.adb:P2.F:12

sets a breakpoint at line 12 in P2.F.

We would like to contribute some version of both of these to the public
sources. Before doing so, however, we'd like to solicit comments.

Paul Hilfinger