From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 420113858D20; Fri, 3 Feb 2023 16:17:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 420113858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675441057; bh=Y4ds887Scoy9Yc7/FXzZAnStOmvsaDbmkCUo/8TiEZg=; h=From:To:Subject:Date:From; b=qpkDzciog5VpqNrwMrAUxJRdDuLzfT4H0UyrWMgpdAsNd/UPPkFepwHEJCnLbdRoV w0o027pff89G8AbIlt3jRinwVs4umU37RbF2TdvThos2LujoRDoRiSP0OJ8FC6pUIU gubkZuhiWdDEo8XgPn3Zx7tMWy2HiALljicp/BJE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: remove copy_inferior_target_desc_info X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 6b0b81b9f2cb056bd82e9c01f4a5f631ae90938b X-Git-Newrev: 57768366319b362bc54bd2175e09b210ce195688 Message-Id: <20230203161737.420113858D20@sourceware.org> Date: Fri, 3 Feb 2023 16:17:37 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D57768366319b= 362bc54bd2175e09b210ce195688 commit 57768366319b362bc54bd2175e09b210ce195688 Author: Simon Marchi Date: Fri Feb 3 09:21:25 2023 -0500 gdb: remove copy_inferior_target_desc_info =20 This function is now trivial, we can just copy inferior::tdesc_info where needed. =20 Change-Id: I25185e2cd4ba1ef24a822d9e0eebec6e611d54d6 Diff: --- 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 dfe523664de..65863440b9c 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 =3D orginf->tdesc_info; =20 clone_program_space (pspace, orginf->pspace); =20 diff --git a/gdb/infrun.c b/gdb/infrun.c index edfb5ab0a91..87ab73c47a4 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 =3D parent_inf->attach_flag; copy_terminal_info (child_inf, parent_inf); child_inf->gdbarch =3D parent_inf->gdbarch; - copy_inferior_target_desc_info (child_inf, parent_inf); + child_inf->tdesc_info =3D parent_inf->tdesc_info; =20 child_inf->symfile_flags =3D SYMFILE_NO_READ; =20 @@ -546,7 +546,7 @@ holding the child stopped. Try \"set detach-on-fork\" = or \ child_inf->attach_flag =3D parent_inf->attach_flag; copy_terminal_info (child_inf, parent_inf); child_inf->gdbarch =3D parent_inf->gdbarch; - copy_inferior_target_desc_info (child_inf, parent_inf); + child_inf->tdesc_info =3D parent_inf->tdesc_info; =20 if (has_vforked) { diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 0561a8098c5..6defd5bbe86 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 !=3D nullptr && !info->filename.empty (); } =20 -/* See target-descriptions.h. */ - -void -copy_inferior_target_desc_info (struct inferior *destinf, struct inferior = *srcinf) -{ - struct target_desc_info *src =3D &srcinf->tdesc_info; - struct target_desc_info *dest =3D &destinf->tdesc_info; - - *dest =3D *src; -} - /* The string manipulated by the "set tdesc filename ..." command. */ =20 static std::string tdesc_filename_cmd_string; diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index c337c177c8e..b835e144c68 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -48,13 +48,6 @@ void target_clear_description (void); =20 const struct target_desc *target_current_description (void); =20 -/* 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. */