This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix check for ICC incomplete struct types
- From: Michael Eager <eager at eagerm dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 07 Jan 2014 09:21:20 -0800
- Subject: [PATCH] Fix check for ICC incomplete struct types
- Authentication-results: sourceware.org; auth=none
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
>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