From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id A45A8397301B for ; Mon, 14 Jun 2021 21:24:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A45A8397301B 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-wr1-f45.google.com with SMTP id l2so16014764wrw.6 for ; Mon, 14 Jun 2021 14:24:17 -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=uBae1raPYBFyo1Q8y+uRy5H2s+bBxjVWQR4Qq10LnyhIuWxsfrv9yU1ai+Tz7HUIgY 5iLe1o1K2+cwRXb8//6B3UJWbtaY3n2bJIeUnflX/oNf2Kj4HMjcCsJH61Ae/9PMn9sP zJjUqQZ7kxynLZ4xUIyoRoqH3bYw1AEh+fja+DU+gFNIalHRQxlbPUK0Ywf4f3JqKNHe gD0jIlDuUNCt/D1TXikigz+jvgQSqSdWzXyjwZCrVujewWVGsTtuncSDK+L7iRvkAh8h zryz/asXcNHRdXcDEeBp5QBs3FqIPOqfbQyOMx1L6VsUg2fqeU1g8979ylCb6OuQcKOI wJRA== X-Gm-Message-State: AOAM530Tu1a7d3JxcLw7uOLtkNBxxHcu49eQ7FxVILYSyH2iJ40M+bag Nx5SloAzky6gfBhjBXdOx04q1RkvQCD+5w== X-Google-Smtp-Source: ABdhPJyOox5zF1xd2JeDsTnmQ4zJhdIgjN02mYZHlW/swcnGjMBjCgGG7ld4wkfOkzAk0lXxjBxxIQ== X-Received: by 2002:a05:6000:2c4:: with SMTP id o4mr20952066wry.267.1623705856002; Mon, 14 Jun 2021 14:24:16 -0700 (PDT) Received: from localhost ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id w11sm17856890wrv.89.2021.06.14.14.24.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Jun 2021 14:24:15 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 02/16] prefork_hook: Remove 'args' parameter Date: Mon, 14 Jun 2021 22:23:56 +0100 Message-Id: <20210614212410.1612666-3-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210614212410.1612666-1-pedro@palves.net> References: <20210614212410.1612666-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Mon, 14 Jun 2021 21:24:19 -0000 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