This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] multiple breakpoints from FILE:LINE
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: Paul Hilfinger <hilfingr at gnat dot com>, gdb at sourceware dot org
- Date: Fri, 13 Jan 2006 15:56:47 +0400
- Subject: Re: [RFC] multiple breakpoints from FILE:LINE
- References: <20060113104212.0B28848CBD8@nile.gnat.com> <ubqygs6rd.fsf@gnu.org>
> > 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