From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37387 invoked by alias); 22 Jul 2019 14:10:10 -0000 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 Received: (qmail 37173 invoked by uid 89); 22 Jul 2019 14:10:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HTo:U*palves X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.46.225) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Jul 2019 14:10:08 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway22.websitewelcome.com (Postfix) with ESMTP id A6E33C17F for ; Mon, 22 Jul 2019 09:10:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id pZ0whUfbudnCepZ0whzOO0; Mon, 22 Jul 2019 09:10:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K0MJ015MEsqTSAI9DNwKXS8wO0izdh8GXRqvCS2kVug=; b=Dlw0hLHg4KZMTo7x368q+DdMt3 8MC8vex+VyIQqJH5Knl1eVxxM9q5V+gEL9rskzSTdgABUm6KGCksTCqelqQJSGGL0jT8tPq9zbMAF s0VSppvwLxpmFW2+8OarBWWTF; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:52832 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hpZ0w-003yJh-8p; Mon, 22 Jul 2019 09:10:06 -0500 From: Tom Tromey To: Pedro Alves Cc: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] gdb: Show type summary for anonymous structures from c_print_typedef References: <4b4c8db945d3fbd3334b303b7acfa6d2c71b6bf6.1562931337.git.andrew.burgess@embecosm.com> <3df72c85-469b-de6d-adb3-7e7d9ffd8278@redhat.com> <20190719210636.GD23204@embecosm.com> <1fcef366-f0ca-4503-b5cf-b280120c95cf@redhat.com> Date: Mon, 22 Jul 2019 14:10:00 -0000 In-Reply-To: <1fcef366-f0ca-4503-b5cf-b280120c95cf@redhat.com> (Pedro Alves's message of "Sat, 20 Jul 2019 14:47:54 +0100") Message-ID: <875znuw476.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-07/txt/msg00514.txt.bz2 >> typedef struct { >> int i; >> } struct_t; >> >> Both before and after this patch, this is show by 'info types' as: >> >> 3: typedef struct_t struct_t; Pedro> Curious, and odd. There's a weird special case in C++ where this sort of typedef provides the linkage name for an otherwise anonymous structure, and ages ago we needed to work around this. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48603#c5 In the DWARF this looks like: <1><1d>: Abbrev Number: 2 (DW_TAG_structure_type) <1e> DW_AT_byte_size : 4 <1f> DW_AT_decl_file : 1 <20> DW_AT_decl_line : 1 <21> DW_AT_decl_column : 16 <22> DW_AT_linkage_name: (indirect string, offset: 0x0): 8struct_t <26> DW_AT_sibling : <0x36> ... in particular the linkage name is picked up by gdb. Search for "47510" in dwar2read.c. There are a few spots. Tom