aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-04-22 17:22:38 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-04-22 17:22:38 +0200
commit35682f0a64145893cb1f3c0f6df0cfec7330b823 (patch)
treedaecc75de98e836f007486fcaa0e0962bc445100
parent6fee5eee88a622d3e1ce06c18342365a98db1d40 (diff)
downloadgdb-35682f0a64145893cb1f3c0f6df0cfec7330b823.zip
gdb-35682f0a64145893cb1f3c0f6df0cfec7330b823.tar.gz
gdb-35682f0a64145893cb1f3c0f6df0cfec7330b823.tar.bz2
gdb/continuations: remove the 'err' from 'do_all_inferior_continuations'
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-22 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.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/continuations.c12
-rw-r--r--gdb/continuations.h12
-rw-r--r--gdb/inf-loop.c2
-rw-r--r--gdb/infcmd.c5
5 files changed, 21 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 58480dc..c3fc5cd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2021-04-22 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.
+
+2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
* infcmd.c (attach_post_wait): Update the function comment.
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
diff --git a/gdb/continuations.c b/gdb/continuations.c
index 78eb53f..8fe81a7 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 73f01ec..7ebe82a 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 9f038b3..b8f66c3 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 3439568..5c3ee02 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);
}