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

Eli Zaretskii
2008-01-13T04:22:08Z

> Date: Sat, 12 Jan 2008 12:58:17 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, gdb-patches@sourceware.org
>
> On Sat, Jan 12, 2008 at 06:57:39PM +0200, Eli Zaretskii wrote:
> > > Date: Sat, 12 Jan 2008 17:18:03 +0100 (CET)
> > > From: Mark Kettenis <mark.kettenis@xs4all.nl>
> > > CC: gdb-patches@sourceware.org
> > >
> > > > "*FUNCTION" is generally not a useful C expression, unless FUNCTION
> > > > returns a pointer. So I don't want to rely on the user to guess this
> > > > magic in GDB.
> > >
> > > Actually *FUNCTION is a perfectly valid C expression
> >
> > I didn't say it's invalid; I said it was not useful. That is, a
> > casual C programmer is unlikely to think about such an expression.
>
> I suggest you not think of *FUNCTION as dereferencing FUNCTION.
> That's not what the * means here. * means "what follows is an
> expression in the current language; evaluate it as an address and
> break there". In C, a function evaluates to its address (technically,
> decays to a function pointer). The * is not part of the expression.

Sigh. This must be one of those days when I'm unable to explain
myself.

Look, I didn't say _I_ didn't know about *FUNCTION, so you don't need
to explain that to _me_. I said it is generally not used in programs.
Therefore, its use in GDB is unintuitive given just programming
experience.

> 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.