From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mXk4KQefYGphziQAWB0awg (envelope-from ) for ; Wed, 22 Jul 2026 06:44:23 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=kz7JBevY; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9FFE11E099; Wed, 22 Jul 2026 06:44:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2EFC81E099 for ; Wed, 22 Jul 2026 06:44:21 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4955D4BA2E15 for ; Wed, 22 Jul 2026 10:44:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4955D4BA2E15 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=kz7JBevY Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010029.outbound.protection.outlook.com [52.101.201.29]) by sourceware.org (Postfix) with ESMTPS id E44B84BA2E1C for ; Wed, 22 Jul 2026 10:42:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E44B84BA2E1C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E44B84BA2E1C Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.201.29 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1784716972; cv=pass; b=Ke4FqQOhO1w28MfJ9IlJqXhFZup95VXh9ocC8ZIRvS3LTFDmNGDoULjfHFJAldnGJUAmGMXLGWVWcgkY0+5w93196MHYUe1ewrH8dd+KZ9gadiQq1Iss7ADpLwxKex8qEcpLFwOdsKPhOD3u84cDa7ZVnvnwh1ry3MNH2F2gdxs= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1784716972; c=relaxed/simple; bh=KD+W+XhlH2Eurj+oRYwpK+mCI8j/82bVJDhAEWRItaE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vF1dZxNftfUzLX0AQF196RkEiE+kkws9/WRH47YEfL1k6Fb89vX8aONudqK23vXXD9TbCyM/m42+pN3NuWpbUQH45VydB2M5zVTESQ9eB5e/lfF32GRAHUMltWdBmXNqp9G3k/KigeGjZwJaq4zJsp/IsIUrIJ8CgSUJx6tpVI0= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=kz7JBevY DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E44B84BA2E1C ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HkEAT7U1lWc8MWS1lt6+5QtlBtiMcQJu8xBhBAjTIRfJCoVqTPX3EoXL2mZc0LIWBHBHmhCs40hfZEtTvWEPE+buDe3vQY68bWI6YS2xMC0P3gIEkNlMa03+huiXfO/3NJwq/yllbEkvSQHSn7lQw3qjSYyQ7nFGa1AZK7xj/AZpTlC2jFa8/lGbqPAxSfJSh1bsNpOkNb429cdM1FJAVN4QqjyCDxNzRdmsXlzu/9WjtQOLAZWEmSumVafadVR+/4QLlTbtioneqFFzh2Ur+TKJbuK4rB6wbf2Ji2IVqxpb/eyzsDIKm2Y5tP6iAcGRw8tOFyoktZIBBssAxyS+5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FWelziAXILCej5h63R7LK1bZHSVOOSmY9vf9PNRAHkw=; b=KVLIrrHyG9zc7pSACnyKg4PuN3wdz8wfZEf7yNcMe5XeE7E6LXCRcizmfFfh2+Qjw3be3QKEIy8+3cPLMVqOYDm0J017ooaByGl4oTWHSJXzOm//B2AGqCTPvcb+vlRdQP60SsuvvMoKXZU29T5EsuhNOKGgi4GoRD17IEnvz/Thg8FXq3fwYPnaGm3N6SVtnxXEQj/WQebxGobJdRBIVgkQ6zedhIEyFg0tk15pmsocsa8Em1zw45DQsHjovg7e2HT63N0BlSaMEjltOphxnQc7zRzkDS4hPQzt5hh4MTY6atUtmV/9fNS/2ar57v9hJv8NqW6sMtxj0ayep9BLag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FWelziAXILCej5h63R7LK1bZHSVOOSmY9vf9PNRAHkw=; b=kz7JBevYhZUeF4ZkrZeomSHTgwpKFUQ12okF+NrcfdO+PgTD3sOPYkFMDVTxZUdV6osKZ3twudX9kUDCJqVFf0qE265m/SlLEmFxSZCPV1gQD5chd5Ur6hYJ4J3xwpXcDAFC/nzNkiePzg3uHRs4TxRjio9unpM1F5OMEBbTBHI= Received: from CH0PR03CA0116.namprd03.prod.outlook.com (2603:10b6:610:cd::31) by IA0PR12MB9012.namprd12.prod.outlook.com (2603:10b6:208:485::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Wed, 22 Jul 2026 10:42:45 +0000 Received: from CH3PEPF00000013.namprd21.prod.outlook.com (2603:10b6:610:cd:cafe::17) by CH0PR03CA0116.outlook.office365.com (2603:10b6:610:cd::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Wed, 22 Jul 2026 10:42:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CH3PEPF00000013.mail.protection.outlook.com (10.167.244.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.0 via Frontend Transport; Wed, 22 Jul 2026 10:42:45 +0000 Received: from ctr-rack32-mi300x-1.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 22 Jul 2026 05:42:42 -0500 From: Tankut Baris Aktemur To: CC: Subject: [PATCH v2 06/17] gdb: inline address_space_{name, type_instance_flags}_to_{type_instance_flags, name} Date: Wed, 22 Jul 2026 05:41:55 -0500 Message-ID: <20260722-users-aktemur-type-instance-flags-v2-6-d60dcbc2a76f@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260722-users-aktemur-type-instance-flags-v2-0-d60dcbc2a76f@amd.com> References: <20260722-users-aktemur-type-instance-flags-v2-0-d60dcbc2a76f@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.15.0 Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000013:EE_|IA0PR12MB9012:EE_ X-MS-Office365-Filtering-Correlation-Id: 63342fd7-3909-4b44-10d6-08dee7ddf73c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700016|23010399003|1800799024|82310400026|56012099006|11063799006|10067099003|6133799003|18002099003|22082099003|3023799007; X-Microsoft-Antispam-Message-Info: uzOekLh//mAmNVU8JjlHS0TMwbkNTG1rEN6G4FsM6tZd26stOYcBRzXeEAUS53MqKyzPFEA5G1U+Eq63uGHJMFO9MQVB4UYfYo2b7JoTqQybk6YgNBa+6+u3lgfwhjxTMRsV/qWxaI2oi28G8HR+CM7BN61Kxvh/z01o9jpdVlTqe77eFVI4mrRqJ8PDB6ReUHyfG+PN1XXYzlYsMzs0k8YaZap0obDHw+6Y5ksLyO5MtdRM9FygM+dLSCCOzMECydVsIk3IDpPino3s7m18oOZ7GclZKzJyPtY18uHz2P+kYK/jbSx5sLT+557DSqzJXC84TtzNk1vJNqdosFCQdcJijGZtj5mffkEiUnPUtns3ADdH4q8os5B4pz0E/lx41cBwgtnUD7Y+Y3RS7j5v2jO1vGhVo8VcWVENJtXC9YJWkqewu5Au+hzNvaQE6HPl6sQBUTGn3L+qMURz+BPSEdtJ7jg2VMJM539HKKuxhDpj9csvtLvHBPLCPfY2GTLKmgbK5zPGHC6Q15eVj7EY6ZsPuyShk2Wyn1LeZ9ChZ4G9ULl7wbBpsmxvZdAPLGso6vNGxRPC/VTcHflUKYZZLA3cVSjIgLXejlFndHGV8B3dOYXzPNG9jL7/NyFmOIA811WK8uPxpLDwY2EF/8iFuK6+BhczsZ1fgWCXhOMqNMV2VJTVumOuQCCCF0K+0jrWvoY8WsEe6HQF3fVONSlLgg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700016)(23010399003)(1800799024)(82310400026)(56012099006)(11063799006)(10067099003)(6133799003)(18002099003)(22082099003)(3023799007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UgNhJRBDndIXFWae/A5J7sJdy9tPYXj2Ut8kdTxVGkXWTypKfzWWveDK71mB+fUFw1gILqgLn+mhCwPEtdfKjz/gr87opVharoOtNVtLlSO8w4jxPd4d8xGP6P9q05NT0KMFG6/nCdUME/arVVkb7zfUM/B0agPBzcU7C6K9W3deNozwJJw9umLQIhny4WAsN6Y+zR8qhwdQK7R4UgG7zfkztnI3ZImVjHVs/tomQVMbSSoitY/kBbh7ZFmRJtXr8JaJ5S/lQ5dzzgMKmIg7u3yxipofuUpBjnU262xbNaAPqKQ9JvEzKpFevLHX02RMNV1dgq9fOLDrWa8BsE79FjUPVDa0w6vGoicupTFMWuRYmH495nMBoLOFg+VIuHIo9rylGpPliFNU7Yi38Y1ehYmhWLydkS0n6YvBngrlqd/FcX/UNQB+jMljNrBtABBw X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 10:42:45.4354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63342fd7-3909-4b44-10d6-08dee7ddf73c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000013.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB9012 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~public-inbox=simark.ca@sourceware.org This is yet another refactoring step to treat Harvard address space ids and address class ids separately and transparently from the fact that they are stored in type instance flags. The function 'address_space_name_to_type_instance_flags' converts address space and address class names to type instance flags. It deals with the Harvard address space names "code" and "data" as well as architecture specific address class names. As a result, it may produce type instance flags where either the Harvard address space bits or the address class bits are set. The function 'address_space_type_instance_flags_to_name' does the conversion in the opposite direction. Inline the functions and remove them. This is a step towards separating the handling of two concepts. In type-stack.c, which is used by the parser to convert user inputs into types, "@code" and "@data" and architecture-specific address class names are treated the same, too, blurring the difference and their storage in type instance flags. While we inline the use of address_space_name_to_type_instance_flags there, we also separate the two topics by defining different tokens. The patch still pushes type instance flags into the type stack. The subsequent patch will further clean this up to store address class and address space ids. A hardcoded shift operation will go away in a future patch. --- gdb/c-typeprint.c | 17 ++++++-- gdb/gdbtypes.c | 45 ---------------------- gdb/gdbtypes.h | 6 --- gdb/testsuite/gdb.base/address_space_qualifier.exp | 4 +- gdb/type-stack.c | 33 +++++++++++++--- gdb/type-stack.h | 31 +++++++++------ 6 files changed, 62 insertions(+), 74 deletions(-) diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 1168464a9f9..db3bc29475f 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -19,6 +19,7 @@ #include "event-top.h" #include "bfd.h" #include "symtab.h" +#include "gdbarch.h" #include "gdbtypes.h" #include "expression.h" #include "value.h" @@ -482,10 +483,18 @@ c_type_print_modifier (struct type *type, struct ui_file *stream, did_print_modifier = 1; } - address_space_id - = address_space_type_instance_flags_to_name (type->arch (), - type->instance_flags ()); - if (address_space_id) + address_space_id = nullptr; + + if (TYPE_CODE_SPACE (type)) + address_space_id = "code"; + else if (TYPE_DATA_SPACE (type)) + address_space_id = "data"; + else if (gdbarch_address_class_id_to_name_p (type->arch ())) + address_space_id + = gdbarch_address_class_id_to_name (type->arch (), + TYPE_ADDRESS_CLASS (type)); + + if (address_space_id != nullptr) { if (did_print_modifier || need_pre_space) gdb_printf (stream, " "); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 87cc7d15d0d..97f1b3e1417 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -536,51 +536,6 @@ lookup_function_type_with_arguments (struct type *return_type, return create_function_type (return_type, nparams, param_types); } -/* Identify address space identifier by name -- return a - type_instance_flags. */ - -type_instance_flags -address_space_name_to_type_instance_flags (struct gdbarch *gdbarch, - const char *space_identifier) -{ - /* Check for known address space delimiters. */ - if (streq (space_identifier, "code")) - return TYPE_INSTANCE_FLAG_CODE_SPACE; - else if (streq (space_identifier, "data")) - return TYPE_INSTANCE_FLAG_DATA_SPACE; - - unsigned int aclass; - if (gdbarch_address_class_name_to_id_p (gdbarch) - && gdbarch_address_class_name_to_id (gdbarch, - space_identifier, - aclass)) - { - return (enum type_instance_flag_value) (aclass << 4); - } - else - error (_("Unknown address space specifier: \"%s\""), space_identifier); -} - -/* Identify address space identifier by type_instance_flags and return - the string version of the address space name. */ - -const char * -address_space_type_instance_flags_to_name (struct gdbarch *gdbarch, - type_instance_flags space_flag) -{ - if (space_flag & TYPE_INSTANCE_FLAG_CODE_SPACE) - return "code"; - else if (space_flag & TYPE_INSTANCE_FLAG_DATA_SPACE) - return "data"; - - unsigned int aclass = TYPE_ADDRESS_CLASS_FROM_INSTANCE_FLAGS (space_flag); - - if (gdbarch_address_class_id_to_name_p (gdbarch)) - return gdbarch_address_class_id_to_name (gdbarch, aclass); - else - return NULL; -} - /* Create a new type with instance flags NEW_FLAGS, based on TYPE. If STORAGE is non-NULL, create the new type instance there. diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 3c21d4ad214..1d5c96ab2c1 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -2420,12 +2420,6 @@ extern struct type *make_atomic_type (struct type *); extern void replace_type (struct type *, struct type *); -extern type_instance_flags address_space_name_to_type_instance_flags - (struct gdbarch *, const char *); - -extern const char *address_space_type_instance_flags_to_name - (struct gdbarch *, type_instance_flags); - extern struct type *make_type_with_address_space (struct type *type, type_instance_flags space_identifier); diff --git a/gdb/testsuite/gdb.base/address_space_qualifier.exp b/gdb/testsuite/gdb.base/address_space_qualifier.exp index 49437dad60d..3e94e895493 100644 --- a/gdb/testsuite/gdb.base/address_space_qualifier.exp +++ b/gdb/testsuite/gdb.base/address_space_qualifier.exp @@ -22,12 +22,12 @@ gdb_test_no_output "set language c" with_test_prefix "C" { gdb_test "p *(@somerandomqualifiername int *) 0x12345678" \ - "Unknown address space specifier: \"somerandomqualifiername\"" + "Unknown address space/class specifier: \"somerandomqualifiername\"" } gdb_test_no_output "set language c++" with_test_prefix "C++" { gdb_test "p *(@somerandomqualifiername int *) 0x12345678" \ - "Unknown address space specifier: \"somerandomqualifiername\"" + "Unknown address space/class specifier: \"somerandomqualifiername\"" } diff --git a/gdb/type-stack.c b/gdb/type-stack.c index d19854363a2..dce1a138e36 100644 --- a/gdb/type-stack.c +++ b/gdb/type-stack.c @@ -20,6 +20,7 @@ #include "type-stack.h" #include "gdbtypes.h" +#include "gdbarch.h" /* See type-stack.h. */ @@ -51,10 +52,29 @@ type_stack::insert (struct gdbarch *gdbarch, const char *string) Otherwise, simply push this on the top of the stack. */ int slot = (!m_elements.empty ()) ? 1 : 0; - insert_into (slot, tp_space_identifier); - insert_into (slot, - address_space_name_to_type_instance_flags (gdbarch, - string)); + /* Check for Harvard address space delimiters and + architecture-specific address classes. */ + if (streq (string, "code")) + { + insert_into (slot, tp_harvard_aspace_identifier); + insert_into (slot, TYPE_INSTANCE_FLAG_CODE_SPACE); + } + else if (streq (string, "data")) + { + insert_into (slot, tp_harvard_aspace_identifier); + insert_into (slot, TYPE_INSTANCE_FLAG_DATA_SPACE); + } + else if (unsigned int aclass = 0; + gdbarch_address_class_name_to_id_p (gdbarch) + && gdbarch_address_class_name_to_id (gdbarch, + string, + aclass)) + { + insert_into (slot, tp_aclass_identifier); + insert_into (slot, (enum type_instance_flag_value) (aclass << 4)); + } + else + error (_("Unknown address space/class specifier: \"%s\""), string); } /* See type-stack.h. */ @@ -112,7 +132,10 @@ type_stack::follow_types (struct type *follow_type) case tp_volatile: make_volatile = 1; break; - case tp_space_identifier: + case tp_harvard_aspace_identifier: + make_addr_space = (enum type_instance_flag_value) pop_int (); + break; + case tp_aclass_identifier: make_addr_space = (enum type_instance_flag_value) pop_int (); break; case tp_atomic: diff --git a/gdb/type-stack.h b/gdb/type-stack.h index 1be6d569d8e..19199afd432 100644 --- a/gdb/type-stack.h +++ b/gdb/type-stack.h @@ -45,9 +45,12 @@ enum type_pieces tp_function_with_arguments, tp_const, tp_volatile, - /* An address space identifier. The address space is also pushed on + /* An Harvard address space identifier (i.e. "code" or "data"). The + address space is also pushed on the stack. */ + tp_harvard_aspace_identifier, + /* An address class identifier. The address class is also pushed on the stack. */ - tp_space_identifier, + tp_aclass_identifier, tp_atomic, tp_restrict, /* A separate type stack, which is also pushed onto this type @@ -114,7 +117,8 @@ struct type_stack accept an integer argument are allowed. */ void push (enum type_pieces tp, int n) { - gdb_assert (tp == tp_array || tp == tp_space_identifier || tp == tp_kind); + gdb_assert (tp == tp_array || tp == tp_harvard_aspace_identifier + || tp == tp_aclass_identifier || tp == tp_kind); type_stack_elt elt; elt.int_val = n; m_elements.push_back (elt); @@ -172,7 +176,8 @@ struct type_stack type_stack_elt elt = m_elements.back (); m_elements.pop_back (); type_pieces tp = elt.piece; - gdb_assert (tp == tp_array || tp == tp_space_identifier || tp == tp_kind); + gdb_assert (tp == tp_array || tp == tp_harvard_aspace_identifier + || tp == tp_aclass_identifier || tp == tp_kind); elt = m_elements.back (); m_elements.pop_back (); return elt.int_val; @@ -204,13 +209,14 @@ struct type_stack return elt.stack_val; } - /* Insert a tp_space_identifier and the corresponding address space - value into the stack. STRING is the name of an address space, as - recognized by address_space_name_to_type_instance_flags. If the - stack is empty, the new elements are simply pushed. If the stack - is not empty, this function assumes that the first item on the - stack is a tp_pointer, and the new values are inserted above the - first item. */ + /* Insert an address space or address class identifier and the + corresponding id value into the stack. STRING is the name of a + Harvard address space ("code" or "data"), or the name of an + address class as recognized by gdbarch_address_class_name_to_id. + If the stack is empty, the new elements are simply pushed. If + the stack is not empty, this function assumes that the first item + on the stack is a tp_pointer, and the new values are inserted + above the first item. */ void insert (struct gdbarch *gdbarch, const char *string); @@ -266,7 +272,8 @@ struct type_stack { return (tp == tp_array || tp == tp_kind || tp == tp_type_stack || tp == tp_function_with_arguments - || tp == tp_space_identifier); + || tp == tp_harvard_aspace_identifier + || tp == tp_aclass_identifier); } -- 2.34.1