This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 20 May 2001 02:28:59 -0500
- Cc: gdb-patches at sources dot redhat dot com
- References: <1010519003833.ZM16512@ocotillo.lan>
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.