From patchwork Wed Jan 10 07:24:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 25305 Received: (qmail 125917 invoked by alias); 10 Jan 2018 07:25:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 125906 invoked by uid 89); 10 Jan 2018 07:25:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=impacted X-HELO: rock.gnat.com Received: from Unknown (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jan 2018 07:25:07 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 56814117B02 for ; Wed, 10 Jan 2018 02:25:00 -0500 (EST) 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 JUmPvM2BwsRw for ; Wed, 10 Jan 2018 02:25:00 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 4512E117AFF for ; Wed, 10 Jan 2018 02:25:00 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4233) id 34CE350B; Wed, 10 Jan 2018 02:25:00 -0500 (EST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/commit] Ada/DWARF: Assume the Ada compiler produces descriptive type attributes Date: Wed, 10 Jan 2018 02:24:58 -0500 Message-Id: <1515569098-36678-1-git-send-email-brobecker@adacore.com> Hello, GCC was enhanced in 2011 to generate this attribute, so I think we can now assume that it is available when using that compiler. Doing so allows us to speed up what we call "parallel type" lookups when processing certain types encoded using the GNAT encoding. This patch changes need_gnat_info to always expect those attributes to be generated when the language is Ada. This is an assumption that on the surfcace looks like it might be a bit on the edge; but in practice, it should be OK because this is only useful in the context of handling GNAT-specific encodings. Other Ada compilers would presumably produce debugging information using pure DWARF constructs, so would not be impacted by this. gdb/ChangeLog: * dwarf2read.c (need_gnat_info): Return nonzero if the cu's language is Ada. Tested on x86_64-linux. I will commit in a week or so unless there are any comments... Thank you, diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index dca2fe9..ad13d4b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -21973,15 +21973,9 @@ die_type (struct die_info *die, struct dwarf2_cu *cu) static int need_gnat_info (struct dwarf2_cu *cu) { - /* FIXME: brobecker/2010-10-12: As of now, only the AdaCore version - of GNAT produces this auxiliary information, without any indication - that it is produced. Part of enhancing the FSF version of GNAT - to produce that information will be to put in place an indicator - that we can use in order to determine whether the descriptive type - info is available or not. One suggestion that has been made is - to use a new attribute, attached to the CU die. For now, assume - that the descriptive type info is not available. */ - return 0; + /* Assume that the Ada compiler was GNAT, which always produces + the auxiliary information. */ + return (cu->language == language_ada); } /* Return the auxiliary type of the die in question using its