* 'finish' command on ppc64
@ 2010-11-08 12:10 Edjunior Barbosa Machado
2010-11-08 12:25 ` Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: Edjunior Barbosa Machado @ 2010-11-08 12:10 UTC (permalink / raw)
To: gdb
Hi,
I've noticed that the behavior of 'finish' command on ppc64 sometimes seems to be different to what happens on x86 and ppc32.
On ppc64, when issuing a 'finish' command inside a subroutine, when the routine is in another object file, the program stops at the same line of the subroutine call, while on x86, ppc32 and sometimes on ppc64 (when the routine is in the same object file) it always stops at the line after the call. It happens due to an extra nop instruction after function calls on ppc64 (required by the ABI), in order to allow the linker to insert additional code if necessary during the linking process.
So, I'd like to know if there is any rule regarding of which line of code should be pointed after issue a 'finish' command. Should be always one line after the subroutine call? Is this behavior considered a bug or it's just working as expected?
Thanks,
--
Edjunior
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 'finish' command on ppc64
2010-11-08 12:10 'finish' command on ppc64 Edjunior Barbosa Machado
@ 2010-11-08 12:25 ` Jan Kratochvil
2010-11-08 15:43 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-11-08 12:25 UTC (permalink / raw)
To: Edjunior Barbosa Machado; +Cc: gdb
On Mon, 08 Nov 2010 13:10:05 +0100, Edjunior Barbosa Machado wrote:
> So, I'd like to know if there is any rule regarding of which line of code
> should be pointed after issue a 'finish' command. Should be always one line
> after the subroutine call? Is this behavior considered a bug or it's just
> working as expected?
It was discussed at:
Re: [FYI] Inlining support, rough patch
http://sourceware.org/ml/gdb-patches/2009-06/msg00786.html
with some Fedora patch (later dropped) so that after `finish' GDB would
_always_ stay at the caller line.
Currently testcases expect both cases:
gdb.base/finish.exp
# Some architectures will have one or more instructions after the
# call instruction which still is part of the call sequence, so we
# must be prepared for a "finish" to show us the void_func call
# again as well as the statement after.
Regards,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 'finish' command on ppc64
2010-11-08 12:25 ` Jan Kratochvil
@ 2010-11-08 15:43 ` Joel Brobecker
0 siblings, 0 replies; 3+ messages in thread
From: Joel Brobecker @ 2010-11-08 15:43 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Edjunior Barbosa Machado, gdb
> It was discussed at:
> Re: [FYI] Inlining support, rough patch
> http://sourceware.org/ml/gdb-patches/2009-06/msg00786.html
>
> with some Fedora patch (later dropped) so that after `finish' GDB would
> _always_ stay at the caller line.
Interesting. I'm not sure I would agree if the jump was the last insn
of the line... Showing the caller's line in this case would be a
departure from the usual behavior of showing the next insn, no?
> Currently testcases expect both cases:
> gdb.base/finish.exp
> # Some architectures will have one or more instructions after the
> # call instruction which still is part of the call sequence, so we
> # must be prepared for a "finish" to show us the void_func call
> # again as well as the statement after.
I think that's fine.
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-08 15:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 12:10 'finish' command on ppc64 Edjunior Barbosa Machado
2010-11-08 12:25 ` Jan Kratochvil
2010-11-08 15:43 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox