Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: vladimir@codesourcery.com (Vladimir Prus)
Cc: drow@false.org (Daniel Jacobowitz), gdb-patches@sourceware.org
Subject: Re: [2/10] Remove &builtin_type_ from tdep code (amd64/s390/sparc64)
Date: Wed, 13 Jun 2007 13:06:00 -0000	[thread overview]
Message-ID: <200706131306.l5DD6BO8021072@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200706131108.00541.vladimir@codesourcery.com> from "Vladimir Prus" at Jun 13, 2007 11:08:00 AM

Vladimir Prus wrote:

> I suppose I can change m68k_register_type to directly return
> the type, but I'm not sure why
> 
> 	return builtin_type_double;
> 
> is better than:
> 
> 	return *x;
> 
> where x = &builtin_type_double;

builtin_type_double is currently a global variable that is
gdbarch-swapped, i.e. whenever current_gdbarch switches, the
value of that global variable is re-set.

This is awkward and makes is hard to use any other gdbarch
(that is not currently installed as current_gdbarch) reliably,
which is what my patch set is intended to fix.

To that purpose, the builtin_type_double global variable will
go away, and is (temporarily) replaced by a macro

  #define builtin_type_double
          builtin_type (current_gdbarch)->builtin_double

However, this macro is not fully equivalent; in particular it
is no longer possible to use &builtin_type_double.


Longer term, that compatibility macro will go away as well,
and your
   return builtin_type_double;
should be replaced by
   return builtin_type (gdbarch)->builtin_double;

using the "gdbarch" you get as input to ..._register_type
instead of the global current_gdbarch.  (If you prefer,
you can certainly use that form right away.)

Bye,
Ulrich

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


  reply	other threads:[~2007-06-13 13:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 23:15 Ulrich Weigand
2007-06-12 15:09 ` Daniel Jacobowitz
2007-06-12 15:57   ` Ulrich Weigand
2007-06-12 15:14 ` Daniel Jacobowitz
2007-06-12 16:07   ` Ulrich Weigand
2007-06-13  7:08   ` Vladimir Prus
2007-06-13 13:06     ` Ulrich Weigand [this message]
2007-06-13 13:09       ` Daniel Jacobowitz
2007-06-13 13:17         ` Ulrich Weigand
2007-06-13 13:36           ` Daniel Jacobowitz
2007-06-13 13:57             ` 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=200706131306.l5DD6BO8021072@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=vladimir@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