From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wGdXDd5u7mCsIgAAWB0awg (envelope-from ) for ; Wed, 14 Jul 2021 00:58:06 -0400 Received: by simark.ca (Postfix, from userid 112) id 33E9C1EDEE; Wed, 14 Jul 2021 00:58:06 -0400 (EDT) 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 964401E54D for ; Wed, 14 Jul 2021 00:58:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DDFF397200D for ; Wed, 14 Jul 2021 04:58:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DDFF397200D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626238685; bh=NMTa+X9H/+BZHLYXpC3Te+2IXDtiJ74ggqz8gLckWWY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=CRqdMx1oADpoAqf/ctNVGfv/FPtmBLGbCq991zijCYkN5bal9+lw58hMWqOMKo1dX 8cLEHYcocIkCGNAfVlaEEa+hAwhQU2IaZ7EPplAJSN8HwEQAD3LlOEpC9Bna26BcaF bf5myanOD0yNBGpjBPPIeCWutCWup8nhb9X2j1iU= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 3E1963857827 for ; Wed, 14 Jul 2021 04:55:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E1963857827 X-ASG-Debug-ID: 1626238521-0c856e67e219ef230001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id WorCDJhwVdcTbSn4 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jul 2021 00:55:21 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 61FF9441D68; Wed, 14 Jul 2021 00:55:21 -0400 (EDT) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 05/16] gdb: un-share set_inferior_cwd declaration Date: Wed, 14 Jul 2021 00:55:09 -0400 X-ASG-Orig-Subj: [PATCH 05/16] gdb: un-share set_inferior_cwd declaration Message-Id: <20210714045520.1623120-6-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714045520.1623120-1-simon.marchi@polymtl.ca> References: <20210714045520.1623120-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1626238521 X-Barracuda-Encrypted: DHE-RSA-AES256-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: 2853 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.91193 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 Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" The declaration of set_inferior_cwd is currently shared between gdb and gdbserver, in gdbsupport/common-inferior.h. It doesn't need to be, as set_inferior_cwd is not called from common code. Only get_inferior_cwd needs to. The motivation for this is that a future patch will change the prototype of set_inferior_cwd in gdb, and I don't want to change it for gdbserver unnecessarily. I see this as a good cleanup in any case, to reduce to just the essential what is shared between GDB and GDBserver. Change-Id: I3127d27d078f0503ebf5ccc6fddf14f212426a73 --- gdb/infcmd.c | 5 +++-- gdbserver/inferiors.cc | 2 +- gdbserver/inferiors.h | 4 ++++ gdbsupport/common-inferior.h | 4 ---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 0a5edef69824..a7b520cdd169 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -184,9 +184,10 @@ show_args_command (struct ui_file *file, int from_tty, deprecated_show_value_hack (file, from_tty, c, get_inferior_args ()); } -/* See gdbsupport/common-inferior.h. */ +/* Set the inferior current working directory. If CWD is NULL, unset + the directory. */ -void +static void set_inferior_cwd (const char *cwd) { struct inferior *inf = current_inferior (); diff --git a/gdbserver/inferiors.cc b/gdbserver/inferiors.cc index 3750090c0a14..0a09de79071d 100644 --- a/gdbserver/inferiors.cc +++ b/gdbserver/inferiors.cc @@ -241,7 +241,7 @@ get_inferior_cwd () return current_inferior_cwd; } -/* See gdbsupport/common-inferior.h. */ +/* See inferiors.h. */ void set_inferior_cwd (const char *cwd) diff --git a/gdbserver/inferiors.h b/gdbserver/inferiors.h index 7754f745cd7d..3b8959a28cf7 100644 --- a/gdbserver/inferiors.h +++ b/gdbserver/inferiors.h @@ -154,4 +154,8 @@ void *thread_target_data (struct thread_info *); struct regcache *thread_regcache_data (struct thread_info *); void set_thread_regcache_data (struct thread_info *, struct regcache *); +/* Set the inferior current working directory. If CWD is NULL, unset + the directory. */ +void set_inferior_cwd (const char *cwd); + #endif /* GDBSERVER_INFERIORS_H */ diff --git a/gdbsupport/common-inferior.h b/gdbsupport/common-inferior.h index 3f1b60fd9629..5e1221277b87 100644 --- a/gdbsupport/common-inferior.h +++ b/gdbsupport/common-inferior.h @@ -36,10 +36,6 @@ extern const char *get_exec_file (int err); been set, then return NULL. */ extern const char *get_inferior_cwd (); -/* Set the inferior current working directory. If CWD is NULL, unset - the directory. */ -extern void set_inferior_cwd (const char *cwd); - /* Whether to start up the debuggee under a shell. If startup-with-shell is set, GDB's "run" will attempt to start up -- 2.32.0