From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CLzWCl4hgGBcNwAAWB0awg (envelope-from ) for ; Wed, 21 Apr 2021 08:58:06 -0400 Received: by simark.ca (Postfix, from userid 112) id 291EF1F106; Wed, 21 Apr 2021 08: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 776C31E783 for ; Wed, 21 Apr 2021 08:58:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5049398888F; Wed, 21 Apr 2021 12:58:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5049398888F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619009883; bh=Ao1Bq2FmzfP1OzwyW+o0SI6Uv0dWuWwD5dejGEKAzA4=; h=To:Subject:Date:In-Reply-To:References:In-Reply-To:References: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:From:Reply-To:From; b=ojl93cmVwUOAYo/dtVoAKpVBN4euWuwy73nKlcUuOiF3EyfPoQU9tcJMcyS50TXh3 d9h5gITqPwJSb082UOiHHQ43fpQbabVhyW8KpnqoY0KSXmiQMZKiGzrEIDuAcDnBTF f4lR9tTSwfbnkcSSqrWCyBwJqSV+s+Q3pc4s5QV0= Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id F3268398888F for ; Wed, 21 Apr 2021 12:57:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F3268398888F IronPort-SDR: V76XREx/WUx49gxNgyAMi6NWXs02EG/Ar919Zc7sXR0hR5YrgXMFXNMykqpdA6jFTO2+b5FwOO D6K/lmnA/JVg== X-IronPort-AV: E=McAfee;i="6200,9189,9960"; a="195246570" X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="195246570" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 05:57:51 -0700 IronPort-SDR: UnFtvwM1axxQenQmBzbGzQVXL184023uDZdPVmuNgwUYpYyX1i6XcemI6JmzKHlECJZEjwGCPT /y3oXH0VzZfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="420981305" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga008.fm.intel.com with ESMTP; 21 Apr 2021 05:57:50 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 13LCvnib011354; Wed, 21 Apr 2021 13:57:49 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id 13LCvnaZ031942; Wed, 21 Apr 2021 14:57:49 +0200 Received: (from taktemur@localhost) by ulvlx001.iul.intel.com with LOCAL id 13LCvn5G031938; Wed, 21 Apr 2021 14:57:49 +0200 To: gdb-patches@sourceware.org Subject: [PATCH 3/6] gdb/continuations: remove the 'err' from 'do_all_inferior_continuations' Date: Wed, 21 Apr 2021 14:57:28 +0200 Message-Id: <6152bd70e6450247a4d2bcc516e6be590dce7e0d.1619009681.git.tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: 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: Tankut Baris Aktemur via Gdb-patches Reply-To: Tankut Baris Aktemur Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" The 'err' parameter of 'do_all_inferior_continuations' is effectively unused. There is only one place where the function is called, and there the argument is a literal 0. So, remove the parameter. gdb/ChangeLog: 2021-04-21 Tankut Baris Aktemur * continuations.h (do_all_inferior_continuations): Remove the 'err' parameter. Update the references below. * continuations.c (do_my_continuations_1) (do_my_continuations) (do_all_inferior_continuations): Update. * inf-loop.c (inferior_event_handler): Update. * infcmd.c (attach_command_continuation): Update. --- gdb/continuations.c | 12 ++++++------ gdb/continuations.h | 12 +++--------- gdb/inf-loop.c | 2 +- gdb/infcmd.c | 5 +---- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/gdb/continuations.c b/gdb/continuations.c index 78eb53f860d..8fe81a75ba9 100644 --- a/gdb/continuations.c +++ b/gdb/continuations.c @@ -49,14 +49,14 @@ make_continuation (struct continuation **pmy_chain, } static void -do_my_continuations_1 (struct continuation **pmy_chain, int err) +do_my_continuations_1 (struct continuation **pmy_chain) { struct continuation *ptr; while ((ptr = *pmy_chain) != NULL) { *pmy_chain = ptr->next; /* Do this first in case of recursion. */ - (*ptr->function) (ptr->arg, err); + (*ptr->function) (ptr->arg); if (ptr->free_arg) (*ptr->free_arg) (ptr->arg); xfree (ptr); @@ -64,7 +64,7 @@ do_my_continuations_1 (struct continuation **pmy_chain, int err) } static void -do_my_continuations (struct continuation **list, int err) +do_my_continuations (struct continuation **list) { struct continuation *continuations; @@ -80,7 +80,7 @@ do_my_continuations (struct continuation **list, int err) *list = NULL; /* Work now on the list we have set aside. */ - do_my_continuations_1 (&continuations, err); + do_my_continuations_1 (&continuations); } static void @@ -119,10 +119,10 @@ add_inferior_continuation (continuation_ftype *hook, void *args, /* Do all continuations of the current inferior. */ void -do_all_inferior_continuations (int err) +do_all_inferior_continuations () { struct inferior *inf = current_inferior (); - do_my_continuations (&inf->continuations, err); + do_my_continuations (&inf->continuations); } /* Get rid of all the inferior-wide continuations of INF. */ diff --git a/gdb/continuations.h b/gdb/continuations.h index 73f01ece132..7ebe82af1c5 100644 --- a/gdb/continuations.h +++ b/gdb/continuations.h @@ -30,14 +30,8 @@ struct inferior; /* Prototype of the continuation callback functions. ARG is the continuation argument registered in the corresponding - add_*_continuation call. ERR is true when the command should be - cancelled instead of finished normally. In that case, the - continuation should clean up whatever state had been set up for the - command in question (e.g., remove momentary breakpoints). This - happens e.g., when an error was thrown while handling a target - event, or when the inferior thread the command was being executed - on exits. */ -typedef void (continuation_ftype) (void *arg, int err); + add_*_continuation call. */ +typedef void (continuation_ftype) (void *arg); /* Prototype of the function responsible for releasing the argument passed to the continuation callback functions, either when the @@ -49,7 +43,7 @@ typedef void (continuation_free_arg_ftype) (void *); extern void add_inferior_continuation (continuation_ftype *, void *, continuation_free_arg_ftype *); -extern void do_all_inferior_continuations (int err); +extern void do_all_inferior_continuations (); extern void discard_all_inferior_continuations (struct inferior *inf); #endif diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index 9f038b3d85a..b8f66c308d2 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -55,7 +55,7 @@ inferior_event_handler (enum inferior_event_type event_type) /* Do all continuations associated with the whole inferior (not a particular thread). */ if (inferior_ptid != null_ptid) - do_all_inferior_continuations (0); + do_all_inferior_continuations (); /* When running a command list (from a user command, say), these are only run when the command list is all done. */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 3439568be00..5c3ee02cb9d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2547,14 +2547,11 @@ struct attach_command_continuation_args }; static void -attach_command_continuation (void *args, int err) +attach_command_continuation (void *args) { struct attach_command_continuation_args *a = (struct attach_command_continuation_args *) args; - if (err) - return; - attach_post_wait (a->from_tty, a->mode); } -- 2.17.1