Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Mark Kettenis <kettenis@chello.nl>
Cc: ac131313@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [rfa/amd64] Zero fill 32-bit registers
Date: Sat, 28 Feb 2004 20:40:00 -0000	[thread overview]
Message-ID: <4040FC93.9000100@gnu.org> (raw)
In-Reply-To: <200402282025.i1SKPdRr000430@elgar.kettenis.dyndns.org>

>    It doesn't address the underlying problem where fetching an individual 
>    register leaves half the register field undefined.   The code shouldn't 
>    assume that other code has magically initialized the rest of that 
>    register field.
> 
> OK, but you realize its the problem of the threads code, and *not* the
> code amd64-nat.c?

Both are broken - "society is to blame".

>    >    > Another problem with your patch is that I'd rather like avoid assuming
>    >    > that the register buffer is an array of 8-byte registers.
>    > 
>    >    That code already assumems that, and that the values are little-endian.
>    > 
>    > Yes it assumes little-endianness, but the assumptions on the size of
>    > the slots in the register buffer are weaker.  The register buffer here
>    > corresponds to `struct reg' on the BSD's.  It would be prefectly well
>    > possible for some of its members to be 4 bytes in size.  The current
>    > code works for that case, whereas with your patch, it could thrash
>    > another member of the structure.
> 
>    Do you know of any such an system?
> 
> Actually GNU/Linux x86-64 has a gregset_t where %cs, %fs and %gs are
> stored in a short.
> 
> Could you live with just zero-extending the 16 general-purpose
> registers and the instruction pointer?  I'll implement it for you.

It is certainly an improvement!  Can you test it?

Andrew



  reply	other threads:[~2004-02-28 20:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27  1:22 Andrew Cagney
2004-02-28 10:46 ` Mark Kettenis
2004-02-28 15:17   ` Andrew Cagney
2004-02-28 17:35     ` Mark Kettenis
2004-02-28 19:18       ` Andrew Cagney
2004-02-28 20:26         ` Mark Kettenis
2004-02-28 20:40           ` Andrew Cagney [this message]
2004-02-28 21:56             ` [PATCH] " Mark Kettenis
2004-02-29 23:11               ` Andrew Cagney
2004-02-29 23:45                 ` Mark Kettenis
2004-03-02 16:10                   ` Andrew Cagney
2004-03-19  0:09                     ` Andrew Cagney

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=4040FC93.9000100@gnu.org \
    --to=cagney@gnu.org \
    --cc=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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