public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: yao@codesourcery.com (Yao Qi)
Cc: gdb-patches@sourceware.org,
	thomas@codesourcery.com (Thomas Schwinge),
	       gdb@sourceware.org
Subject: Re: Memory corruption for host double format different from target double format
Date: Fri, 10 Aug 2012 12:57:00 -0000	[thread overview]
Message-ID: <201208101256.q7ACukE5013146@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <6114731.htKcOdL0z6@qiyao.dyndns.org> from "Yao Qi" at Aug 10, 2012 06:37:01 PM

Yao Qi wrote:
> On Friday, August 10, 2012 11:32:53 AM Thomas Schwinge wrote:
> > That is, if set_gdbarch_double_format has not been called, it will
> > default to floatformats_ieee_double -- even though set_gdbarch_double_bit
> > may have been called setting it unequal to the 64-bit double format.
> > Hmm, and gdbarch.c:verify_gdbarch has the following comment on top of it:
> > Ensure that all values in a GDBARCH are reasonable.  ;-)
> 
> Looks like some checking like this is missing?
> 
>   gdbarch->float_format->totalsize <= gdbarch->float_bit
>   gdbarch->double_format->totalsize <= gdbarch->double_bit

In fact, I'd prefer to make gdbarch_double_format etc. *mandatory*
and gdbarch_double_bit etc. optional, defaulting to the format size.
(Currently, _bit is mandatory and _format is optional.)

This would mean that nearly all calls to set_gdbarch_double_bit
could go away, with the exception of special cases like "long double"
on i386 ...

[ I guess we could also hunt down and remove the final few places
that still create a TYPE_CODE_FLT with no format set; then the
floatflormat_from_length routine could go away completely. ]

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

  reply	other threads:[~2012-08-10 12:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 18:19 Thomas Schwinge
2012-08-10  9:33 ` Thomas Schwinge
2012-08-10 10:37   ` Yao Qi
2012-08-10 12:57     ` Ulrich Weigand [this message]
2012-08-10 14:32       ` Mark Kettenis
2012-08-29 15:37         ` Thomas Schwinge
2012-08-30 15:38           ` Thomas Schwinge
2012-09-07  8:20             ` Thomas Schwinge

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=201208101256.q7ACukE5013146@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=thomas@codesourcery.com \
    --cc=yao@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).