Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb-patches@sourceware.org
Subject: Re: [5/10] Add "explicit size" types to builtin_type
Date: Tue, 12 Jun 2007 16:24:00 -0000	[thread overview]
Message-ID: <200706121624.l5CGOd9q019856@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20070612152235.GC16068@caradoc.them.org> from "Daniel Jacobowitz" at Jun 12, 2007 11:22:35 AM

Daniel Jacobowitz wrote:

> This one may be a problem.  From tdesc_named_type:
> 
>   /* Next try some predefined types.  Note that none of these types
>      depend on the current architecture; some of the builtin_type_foo
>      variables are swapped based on the architecture.  */
>   if (strcmp (id, "int8") == 0)
>     return builtin_type_int8;
> 
> This function is returning types for register values, before we have
> constructed the corresponding gdbarch.  We'll now grab them from some
> other random gdbarch (of course, we were sort of doing that before,
> but it worked - in practice these types are never used anywhere that
> their address can be taken).
> 
> I wonder if we could fix this by moving the pointer and reference type
> caches out of the types themselves, and into per-architecture data?
> Or perhaps use tables based only on the pointer size and other
> attributes; they do not really need to be per-architecture, just
> cached.  An i386 and i686 can use the same void *.

Hmmm.  One thing I liked about the approach in my patch was that
it in effect made *all* types gdbarch-specific.  This would have
allowed in the end to implement something like a get_type_arch ()
routine, which could be quite useful to push references to
current_gdbarch out of the symbol parts of the debugger (where
we often do not have a local gdbarch / frame / regcache argument,
but where we typically operate on types or values).

If we have genuinely architecture-independent types, a routine
like lookup_pointer_type cannot be implemented without reference
to a global current_gdbarch (unless it receives an explicit
gdbarch argument and all callers are modified) ...

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-12 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 23:16 Ulrich Weigand
2007-06-12 15:22 ` Daniel Jacobowitz
2007-06-12 16:24   ` Ulrich Weigand [this message]
2007-06-12 16:32     ` Daniel Jacobowitz
2007-06-13 14:10       ` Ulrich Weigand
2007-06-13 14:19         ` Daniel Jacobowitz

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=200706121624.l5CGOd9q019856@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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