This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

In Ada, as Joel said, this is not true.  *FUNCTION won't work, because
the * means "an expression follows" and the name of a function taking
no arguments means to call the function.  The * is language
independent in this context.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]