What should "finish" do?
Peter.Schauer
Peter.Schauer@regent.e-technik.tu-muenchen.de
Wed May 3 01:38:00 GMT 2000
> As I see it, there are two sensible options:
>
> 1) "finish" should finish executing the current function and cause
> execution to stop when control is returned to the caller (at the
> earliest point).
>
> 2) "finish" should finish executing the current function and cause
> execution to stop when control is returned to the caller, but
> after whatever (architecture specific, perhaps even compiler
> specific) instructions are used to restore the caller-save
> registers.
>
> Note that stopping at the next line is not a sensible option because
> if you finish out of g() in f(g()), it is an error to stop execution
> at the next line. I.e, you want to have the opportunity to step into
> f().
And we are interested in the return value of g(), which might already
be clobbered if we stop in the next line.
I'd favor 2) as well, but I suspect that it will add extra hair for some
targets.
--
Peter Schauer pes@regent.e-technik.tu-muenchen.de
More information about the Gdb
mailing list