Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fixup convenience variables on endian switch
Date: Thu, 17 Nov 2005 13:46:00 -0000	[thread overview]
Message-ID: <437C79F7.9080404@st.com> (raw)
In-Reply-To: <20051117034505.GA3057@nevyn.them.org>

Daniel Jacobowitz wrote:
> In addition to Jim's question about structures, and the overall
> question of whether this is worth doing...
> 
> On Wed, Nov 16, 2005 at 02:30:41PM +0000, Andrew STUBBS wrote:
> 
>>+  /* Don't do anything if the endian has not changed.
>>+     Also disregard FP types because they don't seem to vary with
>>+     endian - at least, not on i686 Linux or sparc Solaris.  */
> 
> 
> That's not correct.  The only reason it appears that way is because
> those targets normally support only one endian, so their gdbarch system
> only selects one set of floatformats.  Changing endianness can change
> the layout of the standard floating point types arbitrarily.

OK, so as it is floats work on x86 Linux, sparc Solaris and any other 
platform that happens to do it the same way. On other targets the 
situation is no worse (no different) than it is now.

Is there anything I can do to make this better? If there is no 
definitive way then maintainers/interested parties can always fix it per 
host as they see the problem. A comment to that effect can certainly go in.

As to the struct problem, I admit I had not considered that one. A test 
for it must go in of course.

The problem I am actually trying to solve is that we have addresses and 
such set up by a script that is sourced before the endian of the target 
they will be used with is known.

It seems like quite a lot of effort to recursively walk through a stuct. 
This is probably more because I don't know how than anything else. I am 
sure it is possible.

Also, there are unions to consider. These are even harder because the 
requirement that ints are flipped and floats remain the same (on some 
hosts) is incompatible.

I propose to add a test for struct and union types (bitfields? any 
others?) and leave them alone. Pointers to these types will continue to 
work properly of course.

Andrew


  reply	other threads:[~2005-11-17 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16 15:13 Andrew STUBBS
2005-11-17  0:34 ` Jim Blandy
2005-11-17  3:57 ` Daniel Jacobowitz
2005-11-17 13:46   ` Andrew STUBBS [this message]
2005-11-17 19:22     ` Jim Blandy
2005-11-17 19:25       ` Daniel Jacobowitz
2005-11-17 19:54         ` Andrew STUBBS
2005-11-18  1:27         ` Jim Blandy

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=437C79F7.9080404@st.com \
    --to=andrew.stubbs@st.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.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