Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: Jim Blandy <jimb@redhat.com>
Cc: Daniel Jacobowitz <drow@false.org>,
	Elena Zannoni <ezannoni@redhat.com>,
	gdb-patches@sources.redhat.com
Subject: Re: [RFA/dwarf-2] Fix for the null record problem
Date: Thu, 15 Apr 2004 20:43:00 -0000	[thread overview]
Message-ID: <20040415204338.GE1564@gnat.com> (raw)
In-Reply-To: <vt2ekqp6dmj.fsf@zenia.home>

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

Hello Jim,

Good catch about the is_declaration() case.

> Joel, how about dropping the DW_AT_specification test from
> die_is_declaration, and then using it in the new test in your patch?

Based on Jason's answer, it looks like the DW_AT_specification check
was indeed necessary. I have added a comment in that respect in the
little cleanup patch you suggested earlier. See:

    http://sources.redhat.com/ml/gdb-patches/2004-04/msg00325.html

Here a new version of the initial patch that follows your suggestion
of using die_is_declaration(). It's indeed more correct, and even
easier to read.

2004-04-15  Joel Brobecker  <brobecker@gnat.com>

        * dwarf2read.c (read_structure_scope): Identify stub types
        using die_is_declaration() only.

Tested on x86-linux, no regression.
OK to apply?

Thanks,
-- 
Joel

[-- Attachment #2: dwarf2read.c.null-record.diff --]
[-- Type: text/plain, Size: 764 bytes --]

--- dwarf2read.c.cleanup	2004-04-15 13:23:39.000000000 -0700
+++ dwarf2read.c	2004-04-15 13:36:10.000000000 -0700
@@ -3144,6 +3144,9 @@ read_structure_type (struct die_info *di
       TYPE_LENGTH (type) = 0;
     }
 
+  if (die_is_declaration (die, cu))
+    TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
+
   /* We need to add the type field to the die immediately so we don't
      infinitely recurse when dealing with pointers to the structure
      type within the structure itself. */
@@ -3240,11 +3243,6 @@ read_structure_type (struct die_info *di
 
       do_cleanups (back_to);
     }
-  else
-    {
-      /* No children, must be stub. */
-      TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
-    }
 
   processing_current_prefix = previous_prefix;
   if (back_to != NULL)

  reply	other threads:[~2004-04-15 20:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-19 14:01 Joel Brobecker
2004-02-19 21:52 ` Elena Zannoni
2004-02-19 23:29   ` Andrew Cagney
2004-02-19 23:37   ` Joel Brobecker
2004-02-26  2:31   ` Joel Brobecker
2004-02-26  3:27     ` Daniel Jacobowitz
2004-02-26 19:00       ` Joel Brobecker
2004-04-01  1:18   ` Joel Brobecker
2004-04-13  5:26     ` Joel Brobecker
2004-04-14 17:24       ` Jim Blandy
2004-04-14 17:47         ` Daniel Jacobowitz
2004-04-15  5:01           ` Jim Blandy
2004-04-15 20:43             ` Joel Brobecker [this message]
2004-04-16  3:18               ` Joel Brobecker
2004-04-16  3:59                 ` Jim Blandy
2004-04-15  5:33           ` Jim Blandy
2004-02-26 19:49 Michael Elizabeth Chastain
2004-02-26 20:23 ` Joel Brobecker
2004-02-26 21:34 Michael Elizabeth Chastain

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=20040415204338.GE1564@gnat.com \
    --to=brobecker@gnat.com \
    --cc=drow@false.org \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.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