This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?
On Sun, 2008-01-13 at 01:54 -0500, Eli Zaretskii wrote:
> > Date: Sat, 12 Jan 2008 22:24:50 -0800
> > From: Joel Brobecker <brobecker@adacore.com>
> > Cc: Daniel Jacobowitz <drow@false.org>, mark.kettenis@xs4all.nl,
> > gdb-patches@sourceware.org
> >
> > > > In Ada, as Joel said, this is not true. *FUNCTION won't work
> > >
> > > That's too bad: this is an important feature, so if we cannot make it
> > > work in all languages, we should at least document that.
> >
> > What I suggest is that we document *FUNCTION as a special case and yet
> > very useful form of *EXPRESSION, and explain why it works.
>
> In what languages _does_ it work, besides C/C++?
Speaking from memory, and therefore this may not be the
way it works today...
break *expression used to be a special case of the
break command, and NOT the same as "break (*expression).
The * in this case is (was) NOT treated as the * expression op.
It meant "treat the following expression as a literal address,
and PUT A BREAKPOINT THERE (as opposed to skipping a prologue
first and then putting a breakpoint). It did NOT mean "dereference
a pointer expression".
This is a fallout of the fact that the argument to the break
command is not simply an expression -- an expression is just
one of several possibilities. The "*" is a disambiguator,
albeit perhaps a poorly chosen one. It means, "this is not
an expression, this is a linespec, something that evaluates
to an address, and I don't want any post-processing done
to the address (such as skip-prologue).