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 C8BE03858C52 for ; Fri, 3 Feb 2023 14:30:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8BE03858C52 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 313EUJ2Z026681 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Feb 2023 09:30:23 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 313EUJ2Z026681 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1675434624; bh=3kvUOrSqPdOn4ddVonAvQBiy8kwlNiTnYdNnw0in4qY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cMtxB82Adi+0sgwUiDQ7s1Ya/P6zvFZaV17VSEFNnNC+uzz3ceZN9datvzpTOfYBJ CCX6uHaZFxd2oedQcMbyYEFqxrhaggxQbHec9zczQF0idNla6tnok+t+FfKo8yD1qW h9vAPiCBkAd1e4RxX9iL4B23WXY9mBRT/5Tn3YQQ= 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 506BC1E222; Fri, 3 Feb 2023 09:21:29 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 5/5] gdb: make target_desc_info_from_user_p a method of target_desc_info Date: Fri, 3 Feb 2023 09:21:26 -0500 Message-Id: <20230203142126.286866-6-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:30:19 +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: Move the implementation over to target_desc_info. Remove the target_desc_info forward declaration in target-descriptions.h, it's no longer needed. Change-Id: Ic95060341685afe0b73af591ca6efe32f5e7e892 --- gdb/inferior.c | 2 +- gdb/inferior.h | 5 +++++ gdb/target-descriptions.c | 8 -------- gdb/target-descriptions.h | 8 -------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/gdb/inferior.c b/gdb/inferior.c index 65863440b9c0..a1e3c79d8a20 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -961,7 +961,7 @@ clone_inferior_command (const char *args, int from_tty) /* If the original inferior had a user specified target description, make the clone use it too. */ - if (target_desc_info_from_user_p (&inf->tdesc_info)) + if (inf->tdesc_info.from_user_p ()) inf->tdesc_info = orginf->tdesc_info; clone_program_space (pspace, orginf->pspace); diff --git a/gdb/inferior.h b/gdb/inferior.h index d902881bfe24..bac483f0f78d 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -345,6 +345,11 @@ extern void switch_to_inferior_no_thread (inferior *inf); struct target_desc_info { + /* Returns true if INFO indicates the target description had been supplied by + the user. */ + bool from_user_p () + { return !this->filename.empty (); } + /* A flag indicating that a description has already been fetched from the target, so it should not be queried again. */ bool fetched = false; diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 6defd5bbe863..b08a185dfa21 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -451,14 +451,6 @@ get_arch_data (struct gdbarch *gdbarch) return result; } -/* See target-descriptions.h. */ - -int -target_desc_info_from_user_p (struct target_desc_info *info) -{ - return info != nullptr && !info->filename.empty (); -} - /* The string manipulated by the "set tdesc filename ..." command. */ static std::string tdesc_filename_cmd_string; diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index b835e144c680..ee48fdfaa0c2 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -26,9 +26,6 @@ struct tdesc_arch_data; struct target_ops; -/* An inferior's target description info is stored in this opaque - object. There's one such object per inferior. */ -struct target_desc_info; struct inferior; /* Fetch the current inferior's description, and switch its current @@ -48,11 +45,6 @@ void target_clear_description (void); const struct target_desc *target_current_description (void); -/* Returns true if INFO indicates the target description had been - supplied by the user. */ - -int target_desc_info_from_user_p (struct target_desc_info *info); - /* Record architecture-specific functions to call for pseudo-register support. If tdesc_use_registers is called and gdbarch_num_pseudo_regs is greater than zero, then these should be called as well. -- 2.39.1