From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0DHPBoMnuWBoIwAAWB0awg (envelope-from ) for ; Thu, 03 Jun 2021 15:03:31 -0400 Received: by simark.ca (Postfix, from userid 112) id 19F681F163; Thu, 3 Jun 2021 15:03:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 7E52C1E01F for ; Thu, 3 Jun 2021 15:03:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 46D2E3990011 for ; Thu, 3 Jun 2021 19:03:29 +0000 (GMT) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id 2BF37398E40B for ; Thu, 3 Jun 2021 19:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2BF37398E40B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id f17so4027698wmf.2 for ; Thu, 03 Jun 2021 12:02:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gU7jE9Tmnru95/OdrNg/OxZvB8UsH+mXVer2dBHV2/w=; b=aHZ4/wgOcov22KFuIIF9s56pI+5tkHW5EgPIgWS8P85ioc37xD+tYqFK8JZT2eMMHE HyhGnBV18+DwHApmPs7RuMkJwJWvQLtVfgOrJlYA226KL5IUgui3bpkWYj5Qh2p7HKom pvqAOvPLt6dxFyJn/My+jlXSB1zU9n0lJNqcT4HPwQi3BKB3bPH70b+D137982fCYGrZ 51yIPXHKxHw2orXAifOEXSLRM728hWGguQEY+j0/epCVobc9g4tt9g5pTZNwu0UVZRqD MPAKE7VUdBNLbUu3SgiTVu2OgXXIyfn65UaN3O+1EQVIHpqehwl6t4q8tuHNi6azdla+ z1pg== X-Gm-Message-State: AOAM53372hSl4IgUq2ENuXfKVIvAh/ZW9+b6qiZccfwePR9Ov1fCX/Gn XhQFDVnE16k+KX14yqKPyzDyZJFlgyN/MA== X-Google-Smtp-Source: ABdhPJxsJh1M12kz0ayxPgrA0Ad+X5afP2Ib+GYjG7VaTvyIPSKw3mubKBhscT6ULwT3ZCdG46Fp8w== X-Received: by 2002:a7b:c193:: with SMTP id y19mr510894wmi.172.1622746970579; Thu, 03 Jun 2021 12:02:50 -0700 (PDT) Received: from localhost ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id p12sm6122004wme.43.2021.06.03.12.02.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 12:02:49 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 02/17] prefork_hook: Remove 'args' parameter Date: Thu, 3 Jun 2021 20:02:28 +0100 Message-Id: <20210603190243.2609886-3-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210603190243.2609886-1-pedro@palves.net> References: <20210603190243.2609886-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" prefork_hook's 'args' parameter is only used in debug output in gdbserver. Remove it. gdb/ChangeLog: yyyy-mm-dd Pedro Alves * fork-child.c (prefork_hook): Remove 'args' parameter. All callers adjusted. * nat/fork-inferior.h (prefork_hook): Remove 'args' parameter. All callers adjusted. * nat/fork-inferior.c (fork_inferior): Adjust. gdbserver/fork-child.cc yyyy-mm-dd Pedro Alves * fork-child.cc (prefork_hook): Remove 'args' parameter, and references. Change-Id: Iaf8977af7dd6915c123b0d50ded93395bdafd920 --- gdb/fork-child.c | 2 +- gdb/nat/fork-inferior.c | 2 +- gdb/nat/fork-inferior.h | 7 +++---- gdbserver/fork-child.cc | 7 +------ 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gdb/fork-child.c b/gdb/fork-child.c index 3ce7d64b855..41135b53f9b 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -59,7 +59,7 @@ static struct ui *saved_ui = NULL; /* See nat/fork-inferior.h. */ void -prefork_hook (const char *args) +prefork_hook () { gdb_assert (saved_ui == NULL); /* Retain a copy of our UI, since the child will replace this value diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c index d280e1120cc..7d56250c979 100644 --- a/gdb/nat/fork-inferior.c +++ b/gdb/nat/fork-inferior.c @@ -317,7 +317,7 @@ fork_inferior (const char *exec_file_arg, const std::string &allargs, /* Perform any necessary actions regarding to TTY before the fork/vfork call. */ - prefork_hook (allargs.c_str ()); + prefork_hook (); /* It is generally good practice to flush any possible pending stdio output prior to doing a fork, to avoid the possibility of both diff --git a/gdb/nat/fork-inferior.h b/gdb/nat/fork-inferior.h index aae2aa6a854..f45ec9047c8 100644 --- a/gdb/nat/fork-inferior.h +++ b/gdb/nat/fork-inferior.h @@ -58,10 +58,9 @@ extern ptid_t startup_inferior (process_stratum_target *proc_target, struct target_waitstatus *mystatus, ptid_t *myptid); -/* Perform any necessary tasks before a fork/vfork takes place. ARGS - is a string containing all the arguments received by the inferior. - This function is mainly used by fork_inferior. */ -extern void prefork_hook (const char *args); +/* Perform any necessary tasks before a fork/vfork takes place. This + function is mainly used by fork_inferior. */ +extern void prefork_hook (); /* Perform any necessary tasks after a fork/vfork takes place. This function is mainly used by fork_inferior. */ diff --git a/gdbserver/fork-child.cc b/gdbserver/fork-child.cc index a431e7ef889..9678133243d 100644 --- a/gdbserver/fork-child.cc +++ b/gdbserver/fork-child.cc @@ -42,14 +42,9 @@ restore_old_foreground_pgrp (void) /* See nat/fork-inferior.h. */ void -prefork_hook (const char *args) +prefork_hook () { client_state &cs = get_client_state (); - if (debug_threads) - { - debug_printf ("args: %s\n", args); - debug_flush (); - } #ifdef SIGTTOU signal (SIGTTOU, SIG_DFL); -- 2.26.2