* [patch] Fix crash on reading gcc HEAD Fortran module
@ 2008-09-01 13:02 Jan Kratochvil
2008-09-01 15:30 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2008-09-01 13:02 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
Hi,
with the current gcc snapshot this testcase
MODULE m
integer :: varx
END MODULE m
USE m, a=>varx
end
crashes gdb HEAD on `break 2' with:
dwarf2read.c:2766: internal-error: process_die: Assertion `die->child == NULL' failed.
A problem internal to GDB has been detected,
While it still cannot reach the imported variables it at least no longer
crashes now. Notified by Tobias Burnus.
Regards,
Jan
[-- Attachment #2: gdb-cvs-module-import.patch --]
[-- Type: text/plain, Size: 864 bytes --]
2008-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Stay compatible after the GCC PR fortran/29635 fix.
* dwarf2read.c (process_die <DW_TAG_imported_module>): Accept (ignored)
child DIEs. Only COMPLAINT for non-Fortran languages.
--- gdb/dwarf2read.c 29 Aug 2008 17:06:05 -0000 1.278
+++ gdb/dwarf2read.c 1 Sep 2008 12:56:19 -0000
@@ -2763,7 +2763,10 @@ process_die (struct die_info *die, struc
Fortran case, so we'll have to replace this gdb_assert if
Fortran compilers start generating that info. */
processing_has_namespace_info = 1;
- gdb_assert (die->child == NULL);
+ if (cu->language != language_fortran && die->child == NULL)
+ complaint (&symfile_complaints,
+ _("%s at offset %d has unexpected children"),
+ dwarf_tag_name (die->tag), die->offset);
break;
default:
new_symbol (die, NULL, cu);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] Fix crash on reading gcc HEAD Fortran module
2008-09-01 13:02 [patch] Fix crash on reading gcc HEAD Fortran module Jan Kratochvil
@ 2008-09-01 15:30 ` Daniel Jacobowitz
2008-09-01 16:51 ` Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-09-01 15:30 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Mon, Sep 01, 2008 at 03:02:12PM +0200, Jan Kratochvil wrote:
> 2008-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Stay compatible after the GCC PR fortran/29635 fix.
> * dwarf2read.c (process_die <DW_TAG_imported_module>): Accept (ignored)
> child DIEs. Only COMPLAINT for non-Fortran languages.
This patch is mostly OK; please complain about children in
DW_TAG_imported_declaration even in Fortran (see the comment above
your change).
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] Fix crash on reading gcc HEAD Fortran module
2008-09-01 15:30 ` Daniel Jacobowitz
@ 2008-09-01 16:51 ` Jan Kratochvil
2008-09-01 22:18 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2008-09-01 16:51 UTC (permalink / raw)
To: gdb-patches; +Cc: Daniel Jacobowitz
[-- Attachment #1: Type: text/plain, Size: 697 bytes --]
On Mon, 01 Sep 2008 17:29:56 +0200, Daniel Jacobowitz wrote:
> please complain about children in DW_TAG_imported_declaration even in
> Fortran (see the comment above your change).
Originally I expected these complaints are just for detected DWARF violations:
_("Offset %d out of bounds for DW_AT_ranges attribute"),
But they are produced even just for unsupported DWARF features:
complaint (&symfile_complaints, _("unsupported tag: '%s'"),
Therefore it should always complain to any such DW_TAG_imported_* tag as they
are always at least unsupported. (And it does not matter if some of their
forms with or without children are invalid for DWARF or not.)
[ approval requested ]
Thanks,
Jan
[-- Attachment #2: gdb-cvs-module-import.patch --]
[-- Type: text/plain, Size: 994 bytes --]
2008-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Stay compatible after the GCC PR fortran/29635 fix.
* dwarf2read.c (process_die <DW_TAG_imported_module>)
(process_die <DW_TAG_imported_module>): Do not assert anything about
these unsupported tags.
--- ./gdb/dwarf2read.c 29 Aug 2008 17:06:05 -0000 1.278
+++ ./gdb/dwarf2read.c 1 Sep 2008 16:35:17 -0000
@@ -2760,10 +2760,10 @@ process_die (struct die_info *die, struc
information contained in these. DW_TAG_imported_declaration
dies shouldn't have children; DW_TAG_imported_module dies
shouldn't in the C++ case, but conceivably could in the
- Fortran case, so we'll have to replace this gdb_assert if
- Fortran compilers start generating that info. */
+ Fortran case. */
processing_has_namespace_info = 1;
- gdb_assert (die->child == NULL);
+ complaint (&symfile_complaints, _("unsupported tag: '%s'"),
+ dwarf_tag_name (die->tag));
break;
default:
new_symbol (die, NULL, cu);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] Fix crash on reading gcc HEAD Fortran module
2008-09-01 16:51 ` Jan Kratochvil
@ 2008-09-01 22:18 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-09-01 22:18 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Mon, Sep 01, 2008 at 06:51:07PM +0200, Jan Kratochvil wrote:
> Therefore it should always complain to any such DW_TAG_imported_* tag as they
> are always at least unsupported. (And it does not matter if some of their
> forms with or without children are invalid for DWARF or not.)
Good point. This is OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-09-01 22:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-01 13:02 [patch] Fix crash on reading gcc HEAD Fortran module Jan Kratochvil
2008-09-01 15:30 ` Daniel Jacobowitz
2008-09-01 16:51 ` Jan Kratochvil
2008-09-01 22:18 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox