From patchwork Thu Jan 18 20:32:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 84375 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 122643858294 for ; Thu, 18 Jan 2024 20:34:44 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 102903858C33 for ; Thu, 18 Jan 2024 20:32:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 102903858C33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 102903858C33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705609936; cv=none; b=jQcPKOCc+ZdNCOHdZFZ0FDECqHtcRLofELP0QJM8YSVz7mjUYfvFyz15gxN/nbl/bae7vqGX5YDn2odKL3owSbbWH9pra6WiOs97htXuS62VPc5vYzoZNbAT6FgQIzg8Sdba1jHkX0++FqDShRYhW0N+Hgtxh83u9gLTqnu23wA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705609936; c=relaxed/simple; bh=PDXNB9UVBsX9KHWnh5UOhYjCBQ1bYKg7qkYm4a2ZjMk=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=Cv/kOVVWCsDx6o81l8RR7U1hmemkLqmMPJPZ1U7Wsetnm0/4dwDQTS4j3PYwXkMXm6MF+Xt8gNwIV66XEyqX2jDinvGcUGt3dq/FESgytwBX51FMpAovVVJ9XpRj2Ffv+xy/ozSiSoib7ZH5BMwKr9d+XDIONimBygxuyftlg+A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTPS id QVe7rgMBzoMN9QZ3arOoA6; Thu, 18 Jan 2024 20:32:10 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QZ3Yr6xsuBnVCQZ3Zrv2Oy; Thu, 18 Jan 2024 20:32:09 +0000 X-Authority-Analysis: v=2.4 cv=H+TIfsUi c=1 sm=1 tr=0 ts=65a98ac9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=1fc2yS3rMq-BXBd_2S0A:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc: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=8Pr5MsK3sARx0lVSdN8gtoIIaMyaPY3h1f5jrpT+2oI=; b=jXHqNGtUmUGp+orxiU4ljicEEJ ckZ6dA9bAXJVCVLFbkNR3n/3gI03GIh1nmUQ40tc4/QqXxbbzrpHlXpihth6ximN1SbfToODzKFDa rXMSvZuisFUhVxNzrS0d6TuqV; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:50746 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rQZ3Y-002DCj-1L for gdb-patches@sourceware.org; Thu, 18 Jan 2024 13:32:08 -0700 From: Tom Tromey Date: Thu, 18 Jan 2024 13:32:04 -0700 Subject: [PATCH v2 06/30] Give names to unspecified types MIME-Version: 1.0 Message-Id: <20240118-submit-domain-hacks-2-v2-6-aecab29fa104@tromey.com> References: <20240118-submit-domain-hacks-2-v2-0-aecab29fa104@tromey.com> In-Reply-To: <20240118-submit-domain-hacks-2-v2-0-aecab29fa104@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rQZ3Y-002DCj-1L X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:50746 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGPe8ofd1CvUzDDm8fBVq3mxmPeLNbbRA/7KNXU9Bz/JAOWW5R/AUCQHM1qVAJCOvO3wvA7jHPL06eAYkBxhlUDjAgzv+o5sKRLnOwk6Zd46LPxvyJLL s56aVJXeivyN3K/mX8F8s3BdCcb5w1fl3zSX/vj+I3dguBEl7xItOAeBUFcFbLTU42AQMEnomFNPUFyR0zVvfrpyvdqD43I3I/0= X-Spam-Status: No, score=-3022.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org A patch later in this series will change check_typedef to also look in the type domain. This change by itself caused a regression, but one that revealed some peculiar behavior. The regression is in nullptr_t.exp, where examining a std::nullptr_t will change from the correct: typedef decltype(nullptr) std::nullptr_t; to typedef void std::nullptr_t; Right now, the DWARF reader marks all unspecified types as stub types. However, this interacts weirdly with check_typedef, which currently does not try to resolve types -- only struct-domain objects. My first attempt here was to fix this by changing void types not to be stub types, as I didn't see what value that provided. However, this caused another regression, because call_function_by_hand_dummy checks for stub-ness: if (values_type == NULL || values_type->is_stub ()) values_type = default_return_type; I'm not really sure why it does this rather than check for TYPE_CODE_VOID. While looking into this, I found another oddity: the DWARF reader correctly creates a type named 'decltype(nullptr)' when it seems a DW_TAG_unspecified_type -- but it creates a symbol named "void" instead. This patch changes the DWARF reader to give the symbol the correct name. This avoids the regression. --- gdb/dwarf2/read.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index a4b8a855e24..078edd8c842 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -6593,6 +6593,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_subrange_type: case DW_TAG_generic_subrange: case DW_TAG_typedef: + case DW_TAG_unspecified_type: /* Add a typedef symbol for the type definition, if it has a DW_AT_name. */ new_symbol (die, read_type_die (die, cu), cu);