This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call



Kevin Buettner <kevinb@cygnus.com> writes:
> On the IA-64, a "finish" won't stop us at the statement after the call
> due to the fact that the "call" instruction isn't the last instruction
> in the call sequence.  (The global pointer still needs to be reset.)
> The patch below tweaks the finish_void test to allow for this
> eventuality.

This kind of thing can happen on other architectures, too.  For
example, on the x86, if the caller uses `push' instructions to pass
parameters to a function, then it will need to pop them once the
function returns.  Like the IA64, there is a cleanup instruction or
two at the return address.  This problem doesn't show up all the time:
often GCC calls a bunch of functions and then pops their arguments all
at once, or omits the pop entirely if it's just going to restore the
sp from the frame pointer.

So, in general, the test suite should never assume that finishing lone
function calls leaves you at the beginning of the next line's code.


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