public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagerm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] Fix check for ICC incomplete struct types
Date: Tue, 07 Jan 2014 17:21:00 -0000	[thread overview]
Message-ID: <52CC3790.4030702@eagerm.com> (raw)

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

GDB contains code in read_structure_type() which is supposed
to check for incorrect DWARF generated by ICC for an incomplete
structure type.  The code is incomplete, in that it doesn't
check for length == 0, and it doesn't set the STUB flag.

This patch adds the test and sets the flag.

gdb:
2014-01-07  Michael Eager <eager@eagercon.com>

    * dwarf2read.c (read_structure_type): Set stub if ICC & length == 0.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

[-- Attachment #2: icc_stub.patch --]
[-- Type: text/x-patch, Size: 929 bytes --]

From 38d324503619d60646d8a5194f80b71b91bcb713 Mon Sep 17 00:00:00 2001
From: Michael Eager <eager@eagercon.com>
Date: Tue, 7 Jan 2014 09:15:48 -0800
Subject: [PATCH] 2014-01-07  Michael Eager <eager@eagercon.com>

   * dwarf2read.c (read_structure_type): Set stub if ICC & length == 0.
---
 gdb/dwarf2read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 23bcfe0..cbec171 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12830,10 +12830,11 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
       TYPE_LENGTH (type) = 0;
     }
 
-  if (producer_is_icc (cu))
+  if (producer_is_icc (cu) && (TYPE_LENGTH (type) == 0))
     {
       /* ICC does not output the required DW_AT_declaration
 	 on incomplete types, but gives them a size of zero.  */
+      TYPE_STUB (type) = 1;
     }
   else
     TYPE_STUB_SUPPORTED (type) = 1;
-- 
1.8.1.4


             reply	other threads:[~2014-01-07 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 17:21 Michael Eager [this message]
2014-01-07 18:43 ` Tom Tromey
2014-01-07 20:16   ` Michael Eager
2014-01-08 16:38     ` Tom Tromey

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=52CC3790.4030702@eagerm.com \
    --to=eager@eagerm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).