public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
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	[thread overview]
Message-ID: <6152bd70e6450247a4d2bcc516e6be590dce7e0d.1619009681.git.tankut.baris.aktemur@intel.com> (raw)
In-Reply-To: <cover.1619009681.git.tankut.baris.aktemur@intel.com>
In-Reply-To: <cover.1619009681.git.tankut.baris.aktemur@intel.com>

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  <tankut.baris.aktemur@intel.com>

	* 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


  parent reply	other threads:[~2021-04-21 12:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 12:57 [PATCH 0/6] Refactoring around inferior continuations Tankut Baris Aktemur
2021-04-21 12:57 ` [PATCH 1/6] gdb/infcmd: remove the unused parameter 'args' in 'attach_post_wait' Tankut Baris Aktemur
2021-04-21 19:24   ` Tom Tromey
2021-04-21 19:32     ` Simon Marchi
2021-04-21 19:47       ` Tom Tromey
2021-04-22  5:57         ` Aktemur, Tankut Baris
2021-04-21 12:57 ` [PATCH 2/6] gdb/infcmd: update the comment for 'attach_post_wait' Tankut Baris Aktemur
2021-04-21 19:25   ` Tom Tromey
2021-04-21 12:57 ` Tankut Baris Aktemur [this message]
2021-04-21 19:29   ` [PATCH 3/6] gdb/continuations: remove the 'err' from 'do_all_inferior_continuations' Tom Tromey
2021-04-21 12:57 ` [PATCH 4/6] gdb/continuations: do minor cleanup Tankut Baris Aktemur
2021-04-21 19:31   ` Tom Tromey
2021-04-21 12:57 ` [PATCH 5/6] gdb/continuations: use lambdas instead of function pointers Tankut Baris Aktemur
2021-04-21 19:43   ` Tom Tromey
2021-04-22  7:49     ` Aktemur, Tankut Baris
2021-04-22 12:50       ` Tom Tromey
2021-04-22 14:07         ` Aktemur, Tankut Baris
2021-04-22 14:12           ` Tom Tromey
2021-04-21 12:57 ` [PATCH 6/6] gdb/continuations: turn continuation functions into inferior methods Tankut Baris Aktemur
2021-04-21 19:46   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6152bd70e6450247a4d2bcc516e6be590dce7e0d.1619009681.git.tankut.baris.aktemur@intel.com \
    --to=tankut.baris.aktemur@intel.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).