Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] gdbserver fetch/store registers problem on s390x
Date: Sun, 15 May 2005 19:39:00 -0000	[thread overview]
Message-ID: <20050515182826.GB1949@nevyn.them.org> (raw)
In-Reply-To: <200505101654.j4AGsTCj028703@53v30g15.boeblingen.de.ibm.com>

On Tue, May 10, 2005 at 06:54:28PM +0200, Ulrich Weigand wrote:
> Hello,
> 
> this patch fixes another problem with gdbserver on s390x occurring
> on recent kernels.  The problem is that some registers accessed by
> ptrace (notably the access registers and the floating-point status
> register) are still 32 bits wide, even though the PTRACE_PEEKUSER
> and PTRACE_POKEUSER commands always transfer 64 bits.
> 
> This is a problem for two reasons: when fetching those registers,
> a 4-byte buffer is allocated via alloca, but then 8 bytes are 
> written to that buffer (which just happens to work because alloca
> rounds the size up to the next multiple of 8 anyway).  The same
> holds for storing the register; but in this case the second 4 bytes
> have just random contents, and recent kernels won't allow the POKEUSER
> command to succeed unless those extra bytes are zero.
> 
> The following patch fixes this problem by always allocating a buffer
> that has multiple of sizeof (PTRACE_XFER_TYPE) as size, and by
> zeroing out the excess bytes of the buffer when storing the register.
> 
> Tested on s390-ibm-linux and s390x-ibm-linux.
> OK?

This is OK.  Thank you!

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-05-15 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-10 19:48 Ulrich Weigand
2005-05-15 19:39 ` Daniel Jacobowitz [this message]
2005-07-13  1:35 ` Daniel Jacobowitz
2005-07-13 12:03   ` Ulrich Weigand

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=20050515182826.GB1949@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=uweigand@de.ibm.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