Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: Jerome Guitton <guitton@adacore.com>
Subject: [RFA] Fix failed assertion hit in check_typedef
Date: Wed, 28 Feb 2007 06:23:00 -0000	[thread overview]
Message-ID: <20070228062337.GS13153@adacore.com> (raw)
In-Reply-To: <20070227120239.GB5164@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]

[switching to gdb-patches]

Hi Daniel,

> How about doing it in the caller?  If you go to check_typedef, you'll
> see that there's already an example of the same thing.  If this is
> DWARF2 and only started happening recently it may be the fault of your
> recent fixes for what empty types constitute a declaration.

Duh, of course! I'm sorry for not having seen this.

Funny enough, just after I worked on this and sent this message to
this list, Someone from the Paris office hit this very same problem,
and I found a checkin in our tree waiting for me when I woke up.
I think the patch follows your suggestion, so here is a slightly
modified version.

2007-02-28  Jerome Guitton  <guitton@adacore.com>
            Joel Brobecker  <brobecker@adacore.com>

        * gdbtypes.c (check_typedef): Do not replace stub type if
        the resolved type is not defined in the same objfile.

I tested it on x86-linux, no regression. Also fixes the problem
at hand.

OK to commit?

Thanks,
-- 
Joel

[-- Attachment #2: gdbtypes.c.diff --]
[-- Type: text/plain, Size: 905 bytes --]

Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.112
diff -u -p -r1.112 gdbtypes.c
--- gdbtypes.c	29 Jan 2007 17:31:05 -0000	1.112
+++ gdbtypes.c	27 Feb 2007 23:24:06 -0000
@@ -1514,7 +1514,15 @@ check_typedef (struct type *type)
 	}
       sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL);
       if (sym)
-	make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type);
+        {
+          /* Same as above for opaque types, we can replace the stub
+             with the complete type only if they are int the same
+             objfile.  */
+	  if (TYPE_OBJFILE (SYMBOL_TYPE(sym)) == TYPE_OBJFILE (type))
+            make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type);
+	  else
+	    type = SYMBOL_TYPE (sym);
+        }
     }
 
   if (TYPE_TARGET_STUB (type))

       reply	other threads:[~2007-02-28  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070227071658.GB13159@adacore.com>
     [not found] ` <20070227120239.GB5164@caradoc.them.org>
2007-02-28  6:23   ` Joel Brobecker [this message]
2007-02-28 11:44     ` Daniel Jacobowitz
2007-02-28 16:36       ` Joel Brobecker

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=20070228062337.GS13153@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guitton@adacore.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