From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cCJ+AzIKq18cGQAAWB0awg (envelope-from ) for ; Tue, 10 Nov 2020 16:46:26 -0500 Received: by simark.ca (Postfix, from userid 112) id 07C191F08E; Tue, 10 Nov 2020 16:46:26 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 ESMTPS id CA14E1F08B for ; Tue, 10 Nov 2020 16:46:22 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D618E398702F; Tue, 10 Nov 2020 21:46:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D618E398702F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605044781; bh=xT29MORuqMNLOCj6/vvcqdzPXJ6zb5qnPJ9+vCWstbk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=iB7ub4b+8oHAuu5dDhDNjQm+Cq2G+R9q7e/hFj9xc7V0STF7sxe20EzK3OJpU5+oc HGH7ZJYiDqI6mK9VJkw7I0TLrz/z1ZnTqx0aFfIcbDxUKWTDGGlDLcIGFFlfNPi0E6 ifpV/M98msWjW2+xhZe9ez4W/gCL7UIa0WmyVvGM= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 9565F3986837 for ; Tue, 10 Nov 2020 21:46:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9565F3986837 X-ASG-Debug-ID: 1605044777-0c856e6cd571470001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id htGWTCrf8HBe7CQ7 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Nov 2020 16:46:17 -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-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id 0480B441D65; Tue, 10 Nov 2020 16:46:16 -0500 (EST) X-Barracuda-RBL-IP: 192.222.181.218 X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 To: gdb-patches@sourceware.org Subject: [PATCH 07/12] gdb: pass inferior to get_linux_inferior_data Date: Tue, 10 Nov 2020 16:46:09 -0500 X-ASG-Orig-Subj: [PATCH 07/12] gdb: pass inferior to get_linux_inferior_data Message-Id: <20201110214614.2842615-8-simon.marchi@efficios.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201110214614.2842615-1-simon.marchi@efficios.com> References: <20201110214614.2842615-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1605044777 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1580 X-Barracuda-BRTS-Status: 1 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=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.85785 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Pass to get_linux_inferior_data the inferior for which we want to obtain the linux-specific data, rather than assuming the current inferior. This helps slightly reduce the diff in the upcoming main patch. Update the sole caller to pass the current inferior. gdb/ChangeLog: * linux-tdep.c (get_linux_inferior_data): Add inferior parameter. (linux_vsyscall_range): Pass current inferior. Change-Id: Ie4b61190e4a2e89b5b55a140cfecd4de66d92393 --- gdb/linux-tdep.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index bacb61398fa..c57181765e0 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -217,13 +217,11 @@ invalidate_linux_cache_inf (struct inferior *inf) valid INFO pointer. */ static struct linux_info * -get_linux_inferior_data (void) +get_linux_inferior_data (inferior *inf) { - struct linux_info *info; - struct inferior *inf = current_inferior (); + linux_info *info = linux_inferior_data.get (inf); - info = linux_inferior_data.get (inf); - if (info == NULL) + if (info == nullptr) info = linux_inferior_data.emplace (inf); return info; @@ -2408,7 +2406,7 @@ linux_vsyscall_range_raw (struct gdbarch *gdbarch, struct mem_range *range) static int linux_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range) { - struct linux_info *info = get_linux_inferior_data (); + struct linux_info *info = get_linux_inferior_data (current_inferior ()); if (info->vsyscall_range_p == 0) { -- 2.28.0