Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <stan@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] amd64 displaced stepping support
Date: Tue, 27 Jan 2009 08:26:00 -0000	[thread overview]
Message-ID: <497E646E.2010108@codesourcery.com> (raw)
In-Reply-To: <20090126230013.5C7F01C72DE@localhost>

Doug Evans wrote:
> Hi.  I took a crack at implementing displaced stepping support for amd64.
>   
Ooh nice! And fortuitous timing, I was supposed to write this very code 
next week...
> Using the disassembler to compute instruction lengths is awkward, I know.
> It's needed in order to compute the address of rip-relative addressing.
> The address is %rip + address-of-next-insn + displacement,
> and the displacement is only 32 bits so it's not guaranteed to be enough
> to cover the distance between the original instruction and its copy.
> To compensate I compute an unused integer reg, set it to
> %rip + address-of-next-insn, and rewrite the insn to use base+disp addressing.
> I think the GNU tools need a general-purpose library of ISA-related tools.
> Until then, I went with the disassembler.  The code is laid out such that
> when a better implementation of computing insn lengths comes along, it
> can be easily dropped in.
>   
My kneejerk would be to borrow libopcodes.
> This also includes a testcase! :-)
> Plus I added a testcase for the i386 case.
>
> Ok to check in?
>   
I read it and it seems sensible, I'm the not the displaced stepping 
maven though.

Stan


  reply	other threads:[~2009-01-27  1:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27  1:33 Doug Evans
2009-01-27  8:26 ` Stan Shebs [this message]
2009-01-27 17:27 ` Pedro Alves
2009-01-28 12:39   ` Doug Evans
2009-01-28 14:34     ` Pedro Alves
2009-01-28 15:05     ` Daniel Jacobowitz
2009-01-27 20:27 ` Daniel Jacobowitz
2009-01-28  0:13   ` Doug Evans
2009-01-28 14:37     ` Daniel Jacobowitz

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=497E646E.2010108@codesourcery.com \
    --to=stan@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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