From patchwork Fri Feb 3 14:21:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 64258 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 CF79038582BD for ; Fri, 3 Feb 2023 14:22:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF79038582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675434148; bh=aH9l0tZ2Z7MfP4txYQB/CGaLZNbDigb0AMIvR/N4nqM=; 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=ADwlA3kU34eHGLOg9E8WkIFl63DybWRgjAJdJzuupmakxua15QTN9o78Bi2Gs0Ar9 +ZIt9nePHZFlB/K6fmgXSAe2SadwUFzcZbySPlYKWB1NQad8UG1bmTFtopi7pyrq0h AYyygdG83kII/rJNNfcAG5iuR37678f+2q0jdRNw= 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 9DC34385842A for ; Fri, 3 Feb 2023 14:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DC34385842A 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 313ELS8a018801 (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 313ELS8a018801 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 CC9221E15D; Fri, 3 Feb 2023 09:21:28 -0500 (EST) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 3/5] gdb: remove get_tdesc_info Date: Fri, 3 Feb 2023 09:21:24 -0500 Message-Id: <20230203142126.286866-4-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: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 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" Remove this function, since it's now a trivial access to inferior::tdesc_info. Change-Id: I3e88a8214034f1a4163420b434be11f51eef462c --- 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 049e42c7ea77..0561a8098c5c 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 = NULL; }; -/* 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). */ @@ -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 = get_tdesc_info (srcinf); - struct target_desc_info *dest = get_tdesc_info (destinf); + struct target_desc_info *src = &srcinf->tdesc_info; + struct target_desc_info *dest = &destinf->tdesc_info; *dest = *src; } @@ -488,7 +480,7 @@ static std::string tdesc_filename_cmd_string; void target_find_description (void) { - target_desc_info *tdesc_info = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = ¤t_inferior ()->tdesc_info; /* 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 = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = ¤t_inferior ()->tdesc_info; 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 = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = ¤t_inferior ()->tdesc_info; 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 = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = ¤t_inferior ()->tdesc_info; tdesc_info->filename = tdesc_filename_cmd_string; @@ -1259,7 +1251,7 @@ show_tdesc_filename_cmd (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - value = get_tdesc_info (current_inferior ())->filename.data (); + value = current_inferior ()->tdesc_info.filename.data (); if (value != NULL && *value != '\0') gdb_printf (file, @@ -1274,7 +1266,7 @@ show_tdesc_filename_cmd (struct ui_file *file, int from_tty, static void unset_tdesc_filename_cmd (const char *args, int from_tty) { - target_desc_info *tdesc_info = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = ¤t_inferior ()->tdesc_info; tdesc_info->filename.clear (); target_clear_description (); @@ -1730,7 +1722,7 @@ maint_print_c_tdesc_cmd (const char *args, int from_tty) 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 = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = ¤t_inferior ()->tdesc_info; tdesc = tdesc_info->tdesc; filename = 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 = get_tdesc_info (current_inferior ())->tdesc; + tdesc = current_inferior ()->tdesc_info.tdesc; } else {