From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 1CDB03858298 for ; Fri, 3 Feb 2023 14:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CDB03858298 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 313ELSgG018791 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Feb 2023 09:21:33 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 313ELSgG018791 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1675434093; bh=wwgmB/1zkGkWiJZTEawDZChecppaxA/m/bY25DmLEMI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iqro+LjJ4sa4W5LlWqgs/23JJW+5rDRS+tOGZgcku4qfpZ5AU72pvPMsbNt9wgyYg MgUl9J6aQEdcktyr3Ja0YmNpkqYUyxrjSl0DiHmWlP17mJq2n9mNisEatJktK6XVtW FUPBnzL/ww6Htu+N28eF5h3/reQ24aQ07ZrcYZw4= Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5183F1E124; Fri, 3 Feb 2023 09:21:28 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/5] gdb: move target_desc_info to inferior.h Date: Fri, 3 Feb 2023 09:21:22 -0500 Message-Id: <20230203142126.286866-2-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203142126.286866-1-simon.marchi@polymtl.ca> References: <20230203142126.286866-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 3 Feb 2023 14:21:28 +0000 X-Spam-Status: No, score=-3189.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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: In preparation for the following patch, where struct inferior needs to "see" struct target_desc_info, move target_desc_info to the header file. I initially moved the structure to target-descriptions.h, and later made inferior.h include target-descriptions.h. This worked, but it then occured to me that target_desc_info is really an inferior property that involves a target description, so I think it makes sense to have it in inferior.h. Change-Id: I3e81d04faafcad431e294357389f3d4c601ee83d --- gdb/inferior.h | 23 +++++++++++++++++++++++ gdb/target-descriptions.c | 26 -------------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/gdb/inferior.h b/gdb/inferior.h index 4d001b0ad50e..5b5eab00546c 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -340,6 +340,29 @@ extern void set_current_inferior (inferior *); selected. */ extern void switch_to_inferior_no_thread (inferior *inf); +/* Info about an inferior's target description. There's one of these + for each inferior. */ + +struct target_desc_info +{ + /* A flag indicating that a description has already been fetched + from the target, so it should not be queried again. */ + bool fetched = false; + + /* The description fetched from the target, or NULL if the target + did not supply any description. Only valid when + FETCHED is set. Only the description initialization + code should access this; normally, the description should be + accessed through the gdbarch object. */ + const struct target_desc *tdesc = nullptr; + + /* If not empty, the filename to read a target description from, as set by + "set tdesc filename ...". + + If empty, there is not filename specified by the user. */ + std::string filename; +}; + /* GDB represents the state of each program execution with an object called an inferior. An inferior typically corresponds to a process but is more general and applies also to targets that do not have a diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 1a451c79b824..076feed0008c 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -436,32 +436,6 @@ struct tdesc_arch_data gdbarch_register_reggroup_p_ftype *pseudo_register_reggroup_p = NULL; }; -/* Info about an inferior's target description. There's one of these - for each inferior. */ - -struct target_desc_info -{ - /* A flag indicating that a description has already been fetched - from the target, so it should not be queried again. */ - - bool fetched = false; - - /* The description fetched from the target, or NULL if the target - did not supply any description. Only valid when - FETCHED is set. Only the description initialization - code should access this; normally, the description should be - accessed through the gdbarch object. */ - - const struct target_desc *tdesc = nullptr; - - /* If not empty, the filename to read a target description from, as set by - "set tdesc filename ...". - - If empty, there is not filename specified by the user. */ - - std::string filename; -}; - /* Get the inferior INF's target description info, allocating one on the stop if necessary. */ -- 2.39.1