From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14775 invoked by alias); 19 Sep 2010 17:39:52 -0000 Received: (qmail 14756 invoked by uid 22791); 19 Sep 2010 17:39:51 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Sep 2010 17:39:46 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8JHdMVC019746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 19 Sep 2010 13:39:22 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8JHdK7K020108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Sep 2010 13:39:22 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o8JHdKIZ018802; Sun, 19 Sep 2010 19:39:20 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o8JHdJ9Z018789; Sun, 19 Sep 2010 19:39:19 +0200 Date: Sun, 19 Sep 2010 23:02:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA/commit] DWARF: Add support for DW_TAG_constant DIEs Message-ID: <20100919173918.GA29737@host1.dyn.jankratochvil.net> References: <1284668546-25877-1-git-send-email-brobecker@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1284668546-25877-1-git-send-email-brobecker@adacore.com> User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-09/txt/msg00333.txt.bz2 On Thu, 16 Sep 2010 22:22:26 +0200, Joel Brobecker wrote: > The GNAT compiler is starting to email DW_TAG_constant dies, gfortran emits them since 2008: http://pkgs.fedoraproject.org/gitweb/?p=gdb.git;a=blob;f=gdb-6.8-fortran-tag-constant.patch;hb=HEAD >From the differences: die_needs_namespace: DW_TAG_constant is missing in your patch, tested by the attached testcase. For gfortran-4.5 it has a prerequisite: [patch] regression on gfortran-4.5: stopped language detection http://sourceware.org/ml/gdb-patches/2010-09/msg00329.html (for gdb.fortran/* one must create ln -s /usr/bin/gfortran $topdir/g77) For add_partial_symbol - why do you make DW_TAG_constant different from DW_TAG_variable? DW_TAG_variable would handle more cases there. Otherwise the patch of mine was forcing TYPE_CONST on that type but it is unclear whether it should not be rather emitted by GCC. DW_TAG_const_type is emitted by gfortran. So GDB is probably OK without forcing it. Thanks, Jan gdb/ 2010-09-19 Jan Kratochvil * dwarf2read.c (die_needs_namespace) : Add also DW_TAG_constant. gdb/testsuite/ 2010-09-19 Jan Kratochvil * gdb.fortran/module.exp (fully qualified name of DW_TAG_constant): New test. * gdb.fortran/module.f90 (mod1) : New constant. --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4599,6 +4601,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) return 1; case DW_TAG_variable: + case DW_TAG_constant: /* We only need to prefix "globally" visible variables. These include any variable marked with DW_AT_external or any variable that lives in a namespace. [Variables in anonymous namespaces --- a/gdb/testsuite/gdb.fortran/module.exp +++ b/gdb/testsuite/gdb.fortran/module.exp @@ -26,6 +26,8 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f77}] } { # The current source language is "auto; currently fortran". gdb_test "p modmany::var_i" " = 14" "stopped language detection" +gdb_test "print mod1::var_const" " = 20" "fully qualified name of DW_TAG_constant" + if ![runto MAIN__] then { perror "couldn't run to breakpoint MAIN__" continue --- a/gdb/testsuite/gdb.fortran/module.f90 +++ b/gdb/testsuite/gdb.fortran/module.f90 @@ -15,6 +15,8 @@ module mod1 integer :: var_i = 1 + integer :: var_const + parameter (var_const = 20) end module mod1 module mod2