From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4558 invoked by alias); 1 Sep 2008 13:02:55 -0000 Received: (qmail 4547 invoked by uid 22791); 1 Sep 2008 13:02:54 -0000 X-Spam-Check-By: sourceware.org Received: from host0.dyn.jankratochvil.net (HELO host0.dyn.jankratochvil.net) (89.250.240.59) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 01 Sep 2008 13:02:17 +0000 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.2) with ESMTP id m81D2DJU010313 for ; Mon, 1 Sep 2008 15:02:13 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.2/Submit) id m81D2C9P010310 for gdb-patches@sourceware.org; Mon, 1 Sep 2008 15:02:12 +0200 Date: Mon, 01 Sep 2008 13:02:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] Fix crash on reading gcc HEAD Fortran module Message-ID: <20080901130212.GA8993@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00003.txt.bz2 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 407 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 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="gdb-cvs-module-import.patch" Content-length: 864 2008-09-01 Jan Kratochvil Stay compatible after the GCC PR fortran/29635 fix. * dwarf2read.c (process_die ): 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); --MGYHOYXEY6WxJCY8--