This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hello,
This is a followup on the thread that started with:
http://sources.redhat.com/ml/gdb-patches/2004-02/msg00058.html
The test proposed under that thread was dropped because an empty
struct is not legal C. However, it is legal in Ada, and I've seen
a message saying that it is also legal in C++.
I have found the source of the problem, and suggest the attached patch.
The problem was that GDB was mistakenly deducing that the empry record
was only a stub because of the lack of fields, and was therefore tagging
it with TYPE_FLAG_STUB. This is not correct. Instead, the right
approach, I believe, is to check for the DW_AT_declaration attribute.
2004-02-19 J. Brobecker <brobecker@gnat.com>
* dwarf2read.c (read_structure_scope): Identify stub types
using the DW_AT_declaration attribute.
tested on x86-linux. No regression. Fixes the testcase that was
proposed by Andrew (even though it is not legal C) and the Ada
case.
OK to apply?
Thanks,
--
Joel
PS: BTW, my past 3 months of traveling will soon be over. The past
couple of weeks have been very hectic. I have noticed that there were
some messages directed at me to which I haven't answered yet. I am
really sorry. I have kept these messages and will try to answer them
soon.
Attachment:
null_record.diff
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |