From: Yao Qi <yao@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [patch] Fix disp-step-syscall.exp on some i386 targets
Date: Tue, 28 Feb 2012 14:57:00 -0000 [thread overview]
Message-ID: <4F4CDCD0.7020906@codesourcery.com> (raw)
In-Reply-To: <20120228134241.GA24390@host2.jankratochvil.net>
On 02/28/2012 09:42 PM, Jan Kratochvil wrote:
> +/* Linux kernel shows PC value after the 'int $0x80' instruction even if
> + inferior is still inside the syscall. On next PTRACE_SINGLESTEP it will
> + finish the syscall but PC will not change.
> +
> + Some vDSOs contain 'int $0x80; ret' and during stepping out of the syscall
> + i386_displaced_step_fixup would keep PC at the displaced pad location.
> + As PC is pointing to the 'ret' instruction before the step
> + i386_displaced_step_fixup would expect inferior has just executed that 'ret'
> + and PC should not be adjusted. In reality it finished syscall instead and
> + PC should get relocated back to its vDSO address. Hide the 'ret'
> + instruction by 'nop' so that i386_displaced_step_fixup is not confused.
> +
> + It is not fully correct as the bytes in struct displaced_step_closure will
> + not match the inferior code. But we would need some new flag in
> + displaced_step_closure otherwise to keep the state that syscall is finishing
> + for the later i386_displaced_step_fixup execution as the syscall execution
> + is already no longer detectable there. The new flag field would mean
> + i386-linux-tdep.c needs to wrap all the displacement methods of i386-tdep.c
> + which does not seem worth it. The same effect is achieved by patching that
> + 'nop' instruction there instead. */
These comments are clear. I like them :)
--
Yao (é½å°§)
next prev parent reply other threads:[~2012-02-28 13:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 20:49 Jan Kratochvil
2012-02-28 8:17 ` Yao Qi
2012-02-28 9:24 ` Jan Kratochvil
2012-02-28 10:14 ` Yao Qi
2012-02-28 13:55 ` Jan Kratochvil
2012-02-28 14:57 ` Yao Qi [this message]
2012-02-29 16:14 ` [commit] " Jan Kratochvil
2012-02-28 15:40 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F4CDCD0.7020906@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox