[RFC] multiple breakpoints from FILE:LINE

Joel Brobecker brobecker@adacore.com
Fri Jan 13 11:56:00 GMT 2006


> > 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.
> 
> Shouldn't it set breakpoints on ALL of those places instead?

I think so. Either this, or ask the user to choose. I think the current
situation is partly historical: In C, the situations where this happens
are rare...

> I'm not sure I understand: why isn't something.adb:12 enough to
> specify the breakpoint location unambiguously?

This is because you may have several instances of the same line. Imagine
that you have an inlined function defined at foobar.c:12. The function
body is duplicated at each call of the function. If the user asks to
insert a breakpoint at this line, which instance/address should the
debugger use?

-- 
Joel



More information about the Gdb mailing list