Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?

Mark Kettenis
2008-01-16T10:35:15Z

> Date: Wed, 16 Jan 2008 06:20:29 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> > Date: Tue, 15 Jan 2008 22:40:22 +0100 (CET)
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > Cc: brobecker@adacore.com (Joel Brobecker), msnyder@specifix.com,
> > mark.kettenis@xs4all.nl, gdb-patches@sourceware.org
> >
> > Eli Zaretskii wrote:
> > > > Date: Tue, 15 Jan 2008 04:38:32 -0800
> > > > From: Joel Brobecker <brobecker@adacore.com>
> > > >
> > > > > By the way, has anyone tried *FILENAME:FUNCTION? I'm surprised that
> > > > > works, since it would have to be part of the C parser.
> > > >
> > > > Confirmed - it doesn't work.
> > >
> > > Which is a bug, IMO: if FUNCTION works, so should FILENAME:FUNCTION,
> > > otherwise GDB is inconsistent in its treatment of locations specs.
> >
> > Actually, I disagree that this is inconsistent. The point is that
> > the EXPRESSION part of a *EXPRESSION location spec is *not* itself
> > a location spec, but an *expression*.
>
> You are talking from the GDB code point of views, while I'm talking
> from the user point of view.
>
> Btw, the manual does not say *EXPRESSION, it says *ADDRESS.

That's fine as long as the manual says that ADDRESS is parsed as an
expression in the current language. Probably writing *ADDRESS in the
manual is better since it makes clear that whatever follows the '*' is
interpreted as an address.

> Anyway, if "break *FILENAME:FUNCTION" does not need to work, then how
> does one set a breakpoint on the entry point of FILENAME:FUNCTION,
> after the suggested change that makes "break FUNCTION" behave
> differently than "break *FUNCTION"?

Joel's change does not change how "break FUNCTION" works at all. It
changes what "break LINE" does in the case where LINE doesn't
correspond to an actual line of source code, and makes it more similar
to what "break FUNCTION" does, which is putting the breakpoint on the
first line of actual code in a function.