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?


Eli Zaretskii <eliz at gnu.org> writes:
> I said it is generally not used in programs.
> Therefore, its use in GDB is unintuitive given just programming
> experience.

It is almost as widely used as function pointers.  In my experience
(including code outside GDB), it's the preferred way to get a function
pointer.

I think the GDB manual should document '*EXPRESSION', and then mention
the useful special case that in C, '*FUNCTION' refers to the first
instruction in FUNCTION, before the stack frame and arguments have
been set up.

I suspect less technical readers will assume that the term 'entry
point' simply means the point at which none of the function's body
statements have executed yet.  It will not suggest to them that the
stack and arguments may be in an odd state.  So if the manual
describes 'break *FUNCTION' as a way to set a breakpoint "at
FUNCTION's entry point", I think many users will use it when they
would be happier with 'break FUNCTION'.  So I think the documentation
for the '*FUNCTION' special case should spell out what that means,
perhaps with a phrase like the one I used in the paragraph before this
one.


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