From patchwork Thu Nov 24 16:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 61085 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 2E5C4382FAFA for ; Thu, 24 Nov 2022 16:05:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E5C4382FAFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669305957; bh=7cCGTFsyO+dZEnGzvLJ4cuB6KwsyMdX1sLOU7fPauRU=; 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=dMn2Vv8PXcxGbTnf3A0Af1Zs4qztHVN1fnkKN7ckPjAee9ZU3tbf+ksq0pjY7axqJ dpeYNtpglsTQ5IQ1ZY1OFmep0wmDyCwo3BoRUjjwQnWfjg7ny/1EOwojcpCxecjaqu +GBDm7G/eF+hislxwMWZlgrUYbyYgmn+6IPi8CaQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id D3F1C3830B26 for ; Thu, 24 Nov 2022 16:04:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3F1C3830B26 X-ASG-Debug-ID: 1669305869-0c856e02a0305f50001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id KgvBgV4Kd9keEKYa (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 Nov 2022 11:04:29 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id 66FB4441D64; Thu, 24 Nov 2022 11:04:29 -0500 (EST) X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/5] gdb: add inferior parameter to target_current_description Date: Thu, 24 Nov 2022 11:04:24 -0500 X-ASG-Orig-Subj: [PATCH 1/5] gdb: add inferior parameter to target_current_description Message-Id: <20221124160428.83804-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221124160428.83804-1-simon.marchi@efficios.com> References: <20221124160428.83804-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1669305869 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2419 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.102368 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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" From: Simon Marchi Make target_current_description not dependent on the current inferior on entry. Update all callers to pass the current inferior, so no change in behavior is expected. Change-Id: Ic3c501bc83eb6950db077001a96a5c70dc8ae942 --- gdb/arch-utils.c | 4 ++-- gdb/target-descriptions.c | 4 ++-- gdb/target-descriptions.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 7b84daf046e..dc67c632155 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -586,7 +586,7 @@ gdbarch_update_p (struct gdbarch_info info) /* Check for the current target description. */ if (info.target_desc == NULL) - info.target_desc = target_current_description (); + info.target_desc = target_current_description (current_inferior ()); new_gdbarch = gdbarch_find_by_info (info); @@ -644,7 +644,7 @@ set_gdbarch_from_file (bfd *abfd) struct gdbarch *gdbarch; info.abfd = abfd; - info.target_desc = target_current_description (); + info.target_desc = target_current_description (current_inferior ()); gdbarch = gdbarch_find_by_info (info); if (gdbarch == NULL) diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 44dea711a39..0d50aadddb8 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -607,9 +607,9 @@ target_clear_description (void) an existing gdbarch. */ const struct target_desc * -target_current_description (void) +target_current_description (inferior *inf) { - target_desc_info *tdesc_info = get_tdesc_info (current_inferior ()); + target_desc_info *tdesc_info = get_tdesc_info (inf); if (tdesc_info->fetched) return tdesc_info->tdesc; diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index 3ab0ae2542d..3049b783e2f 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -46,7 +46,7 @@ void target_clear_description (void); be used by gdbarch initialization code; most access should be through an existing gdbarch. */ -const struct target_desc *target_current_description (void); +const struct target_desc *target_current_description (inferior *inf); /* Copy inferior target description data. Used for example when handling (v)forks, where child's description is the same as the