From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6512 invoked by alias); 29 Nov 2012 13:37:38 -0000 Received: (qmail 6440 invoked by uid 22791); 29 Nov 2012 13:37:37 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 13:37:32 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C783CCB2709; Thu, 29 Nov 2012 14:37:35 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rQgiTjDxP+Qd; Thu, 29 Nov 2012 14:37:35 +0100 (CET) Received: from chelles.act-europe.fr (chelles.act-europe.fr [10.10.0.160]) by mel.act-europe.fr (Postfix) with ESMTP id B0E53CB2259; Thu, 29 Nov 2012 14:37:35 +0100 (CET) Received: by chelles.act-europe.fr (Postfix, from userid 560) id AF8641EA005A; Thu, 29 Nov 2012 14:37:35 +0100 (CET) From: Jerome Guitton To: gdb-patches@sourceware.org Cc: Jerome Guitton Subject: [RFA/Ada 2/4] Strip interface tags from visible fields Date: Thu, 29 Nov 2012 13:37:00 -0000 Message-Id: <1354196235-8414-2-git-send-email-guitton@adacore.com> In-Reply-To: <1354196235-8414-1-git-send-email-guitton@adacore.com> References: <1354196235-8414-1-git-send-email-guitton@adacore.com> 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: 2012-11/txt/msg00855.txt.bz2 The following Ada type: type Circle is new Shape and Drawable with record Center : Point; Radius : Natural; end record; ...is displayed as follow in GDB: (gdb) ptype circle type = new classes.shape with record V51s: ada.tags.interface_tag; center: classes.point; radius: natural; end record V51s is an internal field that is of no interest for the user. It should not be displayed. gdb/ChangeLog: * ada-lang.c (ada_is_interface_tag): New function. (ada_is_ignored_field): Add interface tags to the list of ignored fields. OK to apply? --- gdb/ada-lang.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a34ba29..deefcfb 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5937,6 +5937,19 @@ ada_is_dispatch_table_ptr_type (struct type *type) return (strcmp (name, "ada__tags__dispatch_table") == 0); } +/* Return non-zero if TYPE is an interface tag. */ + +static int +ada_is_interface_tag (struct type *type) +{ + const char *name = TYPE_NAME (type); + + if (name == NULL) + return 0; + + return (strcmp (name, "ada__tags__interface_tag") == 0); +} + /* True if field number FIELD_NUM in struct or union type TYPE is supposed to be invisible to users. */ @@ -5967,9 +5980,11 @@ ada_is_ignored_field (struct type *type, int field_num) return 1; } - /* If this is the dispatch table of a tagged type, then ignore. */ + /* If this is the dispatch table of a tagged type or an interface tag, + then ignore. */ if (ada_is_tagged_type (type, 1) - && ada_is_dispatch_table_ptr_type (TYPE_FIELD_TYPE (type, field_num))) + && (ada_is_dispatch_table_ptr_type (TYPE_FIELD_TYPE (type, field_num)) + || ada_is_interface_tag (TYPE_FIELD_TYPE (type, field_num)))) return 1; /* Not a special field, so it should not be ignored. */ -- 1.7.10.4