From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5668 invoked by alias); 30 Sep 2008 17:07:31 -0000 Received: (qmail 5567 invoked by uid 22791); 30 Sep 2008 17:07:30 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 30 Sep 2008 17:06:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3A0D82A9674; Tue, 30 Sep 2008 13:06:51 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KR-jS3AGWy-r; Tue, 30 Sep 2008 13:06:51 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0400F2A9667; Tue, 30 Sep 2008 13:06:51 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id CED9EE7ACD; Tue, 30 Sep 2008 10:06:48 -0700 (PDT) Date: Tue, 30 Sep 2008 17:07:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFA/DWARF2] Handle nested subprograms in CU pc bound calculation Message-ID: <20080930170648.GI3811@adacore.com> References: <20080930152757.GC23135@adacore.com> <002601c92313$27d06790$777136b0$@u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002601c92313$27d06790$777136b0$@u-strasbg.fr> User-Agent: Mutt/1.4.2.2i 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/msg00580.txt.bz2 Hello Pierre, > Could you please also allow it for pascal language? > Nested functions/procedures are also allowed in pascal. Up to now, I think only Pascal expressed interest in handling nested subprograms besides Ada. The problem is that this change is not the only piece of the whole puzzle. There are other changes, one of them submitted recently, where we had to add some exceptions. With that in mind, I checked my patch in as is for now. But now that we have another language interested in spending the CPU time in handling these subprograms, we might want to introduce a new function that, given a CU (or a language), return true if we should handle nested subprogram, and use that function throughout, instead of hard-coding the language test. static int dwarf2_handle_nested_subprograms (enum language lang) { return (lang == langauge_ada || lang == language_pascal); } Would you like to do that? I can try to point out all the locations where the check for Ada should be replaced by a call to this function. Actually, now that I think of it, a slightly cleaner approach would probably be to extend the language vector to add a flag set to non-zero for the languages that want nested-subprogram handling. The only slight issue is that the CU references the language enum, which means we need to go from that enum to the language_defn to get access to the flag. What do others think? -- Joel