Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Enhance stabs reader to better deal with forward references
Date: Tue, 27 Feb 2007 16:50:00 -0000	[thread overview]
Message-ID: <20070227165003.GB31729@caradoc.them.org> (raw)
In-Reply-To: <20070209194107.GA3365@adacore.com>

On Fri, Feb 09, 2007 at 11:41:07AM -0800, Joel Brobecker wrote:
> That's not where the fun stops, however. The code handling
> const types looks like this:
> 
>     case 'k':                   /* Const qualifier on some type (Sun) */
>       type = read_type (pp, objfile);
>       type = make_cv_type (1, TYPE_VOLATILE (type), type,
>                            dbx_lookup_type (typenums));
>       break;
> 
> In our case, the "make_type" call ended up returning an undefined
> type, and then we end up making a "const" copy of that undefined
> type when calling "make_cv_type".
> 
> The problem is that type 268 (our const type) is "complete", and
> no future stabs entry will ammend it. So even though I some handling
> for forward references of the kind above, this was not sufficient
> because the type attached to our parameter was still an undefined
> type.
> 
> That's why I modified this part of the code to make the cv type
> only when the target type was already defined. Otherwise, we give
> up the "const" qualifier and reuse the target type instead. We
> know that this target type will be fixed up later, so our parameter
> will have a defined type, and we'll be able to print it. We end up
> losing the "const" qualifier, but this is still way better than
> not having any type at all.

I really don't like this part.  I don't understand it, either.  Why is
the CV type complete?  When the non-qualified type is filled in, that
should automatically fill this in, because of the CV ring.  See the
implementation of replace_type.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2007-02-27 16:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 19:40 Joel Brobecker
2007-02-27 16:50 ` Daniel Jacobowitz [this message]
2007-02-28  5:48   ` Joel Brobecker
2007-02-28 11:42     ` Daniel Jacobowitz
2007-02-28 20:12   ` Joel Brobecker
2007-03-27 16:29     ` Daniel Jacobowitz
2007-03-29 18:35       ` Joel Brobecker
2007-03-31 20:42         ` Pedro Alves
2007-04-02  6:59           ` Joel Brobecker
2007-04-02  8:51             ` Pierre Muller
2007-04-02 11:05           ` Daniel Jacobowitz
2007-04-03  0:13             ` Pedro Alves
2007-04-03  3:50               ` Christopher Faylor

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=20070227165003.GB31729@caradoc.them.org \
    --to=drow@false.org \
    --cc=brobecker@adacore.com \
    --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