From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outbound-ss-761.bluehost.com (outbound-ss-761.bluehost.com [74.220.211.250]) by sourceware.org (Postfix) with ESMTPS id E9366385840A for ; Mon, 13 Mar 2023 22:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E9366385840A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw14.mail.unifiedlayer.com (unknown [10.0.90.129]) by progateway8.mail.pro1.eigbox.com (Postfix) with ESMTP id 55DE11004CA48 for ; Mon, 13 Mar 2023 22:08:09 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id bqKvpMgHJTdYmbqKvpNc9P; Mon, 13 Mar 2023 22:08:09 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=D8CCltdj c=1 sm=1 tr=0 ts=640f9ec9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=k__wU0fu6RkA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=1g8rvV1u6asfyHO740cA:9 a=QEXdDO2ut3YA:10:nop_charset_2 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=C4KJk8KBeWst3dPrf8A/71NsohngJWqooQTYz53R12o=; b=WyM8JC1iQNMPQpCywGTulDmnKV XbF54ElM6xnPQot+7KVg9SEkERQd2eb3JIXfM3bO/HJatmhudNXUZGF4owrtHu5Fi5Aqb/dpqLk2h SKTJMGP32mtsOVowl6CTWSOsr; Received: from 71-211-185-113.hlrn.qwest.net ([71.211.185.113]:52788 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pbqKv-000u2m-4y for gdb-patches@sourceware.org; Mon, 13 Mar 2023 16:08:09 -0600 From: Tom Tromey Date: Mon, 13 Mar 2023 16:08:19 -0600 Subject: [PATCH 19/20] Add some types to struct builtin_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230313-split-objfile-type-allocator-2-v1-19-69ba773ac17b@tromey.com> References: <20230313-split-objfile-type-allocator-2-v1-0-69ba773ac17b@tromey.com> In-Reply-To: <20230313-split-objfile-type-allocator-2-v1-0-69ba773ac17b@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.1 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: 71.211.185.113 X-Source-L: No X-Exim-ID: 1pbqKv-000u2m-4y X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-185-113.hlrn.qwest.net ([192.168.0.21]) [71.211.185.113]:52788 X-Source-Auth: tom+tromey.com X-Email-Count: 20 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3026.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This adds some types to struct builtin_type, ensuring it contains all the types currently used by objfile_type. --- gdb/gdbtypes.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/gdbtypes.h | 15 +++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 000e210940c..8fff30f9409 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -6062,6 +6062,56 @@ create_gdbtypes_data (struct gdbarch *gdbarch) builtin_type->xmethod = alloc.new_type (TYPE_CODE_XMETHOD, 0, ""); + /* This type represents a type that was unrecognized in symbol read-in. */ + builtin_type->builtin_error + = alloc.new_type (TYPE_CODE_ERROR, 0, ""); + + /* The following set of types is used for symbols with no + debug information. */ + builtin_type->nodebug_text_symbol + = alloc.new_type (TYPE_CODE_FUNC, TARGET_CHAR_BIT, + ""); + + builtin_type->nodebug_text_gnu_ifunc_symbol + = alloc.new_type (TYPE_CODE_FUNC, TARGET_CHAR_BIT, + ""); + builtin_type->nodebug_text_gnu_ifunc_symbol->set_is_gnu_ifunc (true); + + builtin_type->nodebug_got_plt_symbol + = init_pointer_type (alloc, gdbarch_addr_bit (gdbarch), + "", + builtin_type->nodebug_text_symbol); + builtin_type->nodebug_data_symbol + = alloc.new_type (TYPE_CODE_ERROR, 0, ""); + builtin_type->nodebug_unknown_symbol + = alloc.new_type (TYPE_CODE_ERROR, 0, + ""); + builtin_type->nodebug_tls_symbol + = alloc.new_type (TYPE_CODE_ERROR, 0, + ""); + + /* NOTE: on some targets, addresses and pointers are not necessarily + the same. + + The upshot is: + - gdb's `struct type' always describes the target's + representation. + - gdb's `struct value' objects should always hold values in + target form. + - gdb's CORE_ADDR values are addresses in the unified virtual + address space that the assembler and linker work with. Thus, + since target_read_memory takes a CORE_ADDR as an argument, it + can access any memory on the target, even if the processor has + separate code and data address spaces. + + In this context, builtin_type->builtin_core_addr is a bit odd: + it's a target type for a value the target will never see. It's + only used to hold the values of (typeless) linker symbols, which + are indeed in the unified virtual address space. */ + + builtin_type->builtin_core_addr + = init_integer_type (alloc, gdbarch_addr_bit (gdbarch), 1, + "__CORE_ADDR"); return builtin_type; } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 8a0c57b7a05..34bec887676 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -2098,6 +2098,21 @@ struct builtin_type /* * This type is used to represent an xmethod. */ struct type *xmethod = nullptr; + + /* * This type is used to represent symbol addresses. */ + struct type *builtin_core_addr = nullptr; + + /* * This type represents a type that was unrecognized in symbol + read-in. */ + struct type *builtin_error = nullptr; + + /* * Types used for symbols with no debug information. */ + struct type *nodebug_text_symbol = nullptr; + struct type *nodebug_text_gnu_ifunc_symbol = nullptr; + struct type *nodebug_got_plt_symbol = nullptr; + struct type *nodebug_data_symbol = nullptr; + struct type *nodebug_unknown_symbol = nullptr; + struct type *nodebug_tls_symbol = nullptr; }; /* * Return the type table for the specified architecture. */ -- 2.39.1