From patchwork Fri Feb 3 14:21:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 64259 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 C55283858423 for ; Fri, 3 Feb 2023 14:30:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C55283858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675434647; bh=A39BkjqtSGvcRtHOaZLPkNEg4WgMsn9e0IoWltZyH/M=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=y6SUjQNgJdxbbZNSKu91L/wa3xvMXrAfqZ2XFHn1RNuxPqk/MtHlIKCQ3E2vDWGZq l9e/wj218QfHVqt51XsVrDPYvZi/sCq5xGJT/1Ms9RbbxWj5iHDWLUlL8w2M8UyIce sLemKGAtFEhcGwKenUVcCfseFujFWqEaP5UZD8Wo= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id BD7353858D20 for ; Fri, 3 Feb 2023 14:30:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD7353858D20 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 313EUJgl026680 (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 313EUJgl026680 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 244541E221; Fri, 3 Feb 2023 09:21:28 -0500 (EST) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 4/5] gdb: remove copy_inferior_target_desc_info Date: Fri, 3 Feb 2023 09:21:25 -0500 Message-Id: <20230203142126.286866-5-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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This function is now trivial, we can just copy inferior::tdesc_info where needed. Change-Id: I25185e2cd4ba1ef24a822d9e0eebec6e611d54d6 --- gdb/inferior.c | 2 +- gdb/infrun.c | 4 ++-- gdb/target-descriptions.c | 11 ----------- gdb/target-descriptions.h | 7 ------- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/gdb/inferior.c b/gdb/inferior.c index dfe523664de0..65863440b9c0 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -962,7 +962,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)) - copy_inferior_target_desc_info (inf, orginf); + inf->tdesc_info = orginf->tdesc_info; clone_program_space (pspace, orginf->pspace); diff --git a/gdb/infrun.c b/gdb/infrun.c index edfb5ab0a91f..87ab73c47a4f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -478,7 +478,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ child_inf->attach_flag = parent_inf->attach_flag; copy_terminal_info (child_inf, parent_inf); child_inf->gdbarch = parent_inf->gdbarch; - copy_inferior_target_desc_info (child_inf, parent_inf); + child_inf->tdesc_info = parent_inf->tdesc_info; child_inf->symfile_flags = SYMFILE_NO_READ; @@ -546,7 +546,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ child_inf->attach_flag = parent_inf->attach_flag; copy_terminal_info (child_inf, parent_inf); child_inf->gdbarch = parent_inf->gdbarch; - copy_inferior_target_desc_info (child_inf, parent_inf); + child_inf->tdesc_info = parent_inf->tdesc_info; if (has_vforked) { diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 0561a8098c5c..6defd5bbe863 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -459,17 +459,6 @@ target_desc_info_from_user_p (struct target_desc_info *info) return info != nullptr && !info->filename.empty (); } -/* See target-descriptions.h. */ - -void -copy_inferior_target_desc_info (struct inferior *destinf, struct inferior *srcinf) -{ - struct target_desc_info *src = &srcinf->tdesc_info; - struct target_desc_info *dest = &destinf->tdesc_info; - - *dest = *src; -} - /* 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 c337c177c8e8..b835e144c680 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -48,13 +48,6 @@ void target_clear_description (void); const struct target_desc *target_current_description (void); -/* Copy inferior target description data. Used for example when - handling (v)forks, where child's description is the same as the - parent's, since the child really is a copy of the parent. */ - -void copy_inferior_target_desc_info (struct inferior *destinf, - struct inferior *srcinf); - /* Returns true if INFO indicates the target description had been supplied by the user. */