From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 2FD393858D20; Fri, 3 Feb 2023 16:17:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FD393858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675441052; bh=s2foMNw9P88lJt8s+uXpibfJ2e8pQFLPUbo/KFKTQfI=; h=From:To:Subject:Date:From; b=nZRapYkxPhKLGZnvTzL2YmKGItj4kJcOl0jFQhx324Tof2BB0dVf9RIbKqJn3Ttp6 xt/cSJcVjCArYoey28E+S6wcSCGZRSgZf0lILFVBm1W+Ot/LpX3tMLhKd5wD+6+IEQ Z74qPVbuxqzYE8YGWnUqaNao6HlqDl2jKgwaztwA= 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 get_tdesc_info X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 79846903c6289b2ff12d1830bc2cbf900710556c X-Git-Newrev: 6b0b81b9f2cb056bd82e9c01f4a5f631ae90938b Message-Id: <20230203161732.2FD393858D20@sourceware.org> Date: Fri, 3 Feb 2023 16:17:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6b0b81b9f2cb= 056bd82e9c01f4a5f631ae90938b commit 6b0b81b9f2cb056bd82e9c01f4a5f631ae90938b Author: Simon Marchi Date: Fri Feb 3 09:21:24 2023 -0500 gdb: remove get_tdesc_info =20 Remove this function, since it's now a trivial access to inferior::tdesc_info. =20 Change-Id: I3e88a8214034f1a4163420b434be11f51eef462c Diff: --- gdb/target-descriptions.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 049e42c7ea7..0561a8098c5 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -436,14 +436,6 @@ struct tdesc_arch_data gdbarch_register_reggroup_p_ftype *pseudo_register_reggroup_p =3D NULL; }; =20 -/* Get the inferior INF's target description info. */ - -static struct target_desc_info * -get_tdesc_info (struct inferior *inf) -{ - return &inf->tdesc_info; -} - /* A handle for architecture-specific data associated with the target description (see struct tdesc_arch_data). */ =20 @@ -472,8 +464,8 @@ target_desc_info_from_user_p (struct target_desc_info *= info) void copy_inferior_target_desc_info (struct inferior *destinf, struct inferior = *srcinf) { - struct target_desc_info *src =3D get_tdesc_info (srcinf); - struct target_desc_info *dest =3D get_tdesc_info (destinf); + struct target_desc_info *src =3D &srcinf->tdesc_info; + struct target_desc_info *dest =3D &destinf->tdesc_info; =20 *dest =3D *src; } @@ -488,7 +480,7 @@ static std::string tdesc_filename_cmd_string; void target_find_description (void) { - target_desc_info *tdesc_info =3D get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info =3D ¤t_inferior ()->tdesc_info; =20 /* If we've already fetched a description from the target, don't do it again. This allows a target to fetch the description early, @@ -551,7 +543,7 @@ target_find_description (void) void target_clear_description (void) { - target_desc_info *tdesc_info =3D get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info =3D ¤t_inferior ()->tdesc_info; =20 if (!tdesc_info->fetched) return; @@ -571,7 +563,7 @@ target_clear_description (void) const struct target_desc * target_current_description (void) { - target_desc_info *tdesc_info =3D get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info =3D ¤t_inferior ()->tdesc_info; =20 if (tdesc_info->fetched) return tdesc_info->tdesc; @@ -1246,7 +1238,7 @@ static void set_tdesc_filename_cmd (const char *args, int from_tty, struct cmd_list_element *c) { - target_desc_info *tdesc_info =3D get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info =3D ¤t_inferior ()->tdesc_info; =20 tdesc_info->filename =3D tdesc_filename_cmd_string; =20 @@ -1259,7 +1251,7 @@ show_tdesc_filename_cmd (struct ui_file *file, int fr= om_tty, struct cmd_list_element *c, const char *value) { - value =3D get_tdesc_info (current_inferior ())->filename.data (); + value =3D current_inferior ()->tdesc_info.filename.data (); =20 if (value !=3D NULL && *value !=3D '\0') gdb_printf (file, @@ -1274,7 +1266,7 @@ show_tdesc_filename_cmd (struct ui_file *file, int fr= om_tty, static void unset_tdesc_filename_cmd (const char *args, int from_tty) { - target_desc_info *tdesc_info =3D get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info =3D ¤t_inferior ()->tdesc_info; =20 tdesc_info->filename.clear (); target_clear_description (); @@ -1730,7 +1722,7 @@ maint_print_c_tdesc_cmd (const char *args, int from_t= ty) architecture's. This lets a GDB for one architecture generate C for another architecture's description, even though the gdbarch initialization code will reject the new description. */ - target_desc_info *tdesc_info =3D get_tdesc_info (current_inferior ()= ); + target_desc_info *tdesc_info =3D ¤t_inferior ()->tdesc_info; tdesc =3D tdesc_info->tdesc; filename =3D tdesc_info->filename.data (); } @@ -1803,7 +1795,7 @@ maint_print_xml_tdesc_cmd (const char *args, int from= _tty) architecture's. This lets a GDB for one architecture generate XML for another architecture's description, even though the gdbarch initialization code will reject the new description. */ - tdesc =3D get_tdesc_info (current_inferior ())->tdesc; + tdesc =3D current_inferior ()->tdesc_info.tdesc; } else {