This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Change return type of insert*catchpoint
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 18 Jan 2005 12:06:40 -0500
- Subject: [commit] Change return type of insert*catchpoint
It's always zero, and when there's a problem an error is thrown. Also
allows a throw_reason to be eliminated.
committed,
Andrew
2005-01-18 Andrew Cagney <cagney@gnu.org>
* target.h (struct target_ops): Change return type of
to_insert_fork_catchpoint, to_insert_vfork_catchpoint and
to_insert_exec_catchpoint to void.
(child_insert_fork_catchpoint, child_insert_vfork_catchpoint)
(child_insert_exec_catchpoint): Change return type to void.
* target.c (update_current_target): Update.
(debug_to_insert_fork_catchpoint)
(debug_to_insert_vfork_catchpoint)
(debug_to_insert_exec_catchpoint): Update.
* inf-child.c (inf_child_insert_fork_catchpoint)
(inf_child_insert_vfork_catchpoint)
(inf_child_insert_exec_catchpoint): Update.
* breakpoint.c (insert_catchpoint): Update, do not throw an error.
* linux-nat.c (child_insert_fork_catchpoint)
(child_insert_vfork_catchpoint)
(child_insert_exec_catchpoint): Update.
* inftarg.c (child_insert_fork_catchpoint)
(child_insert_vfork_catchpoint,)
(child_insert_exec_catchpoint): Update.
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.194
diff -p -u -r1.194 breakpoint.c
--- breakpoint.c 14 Jan 2005 23:27:11 -0000 1.194
+++ breakpoint.c 18 Jan 2005 16:51:11 -0000
@@ -718,21 +718,18 @@ insert_catchpoint (struct ui_out *uo, vo
switch (b->type)
{
case bp_catch_fork:
- val = target_insert_fork_catchpoint (PIDGET (inferior_ptid));
+ target_insert_fork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_vfork:
- val = target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
+ target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_exec:
- val = target_insert_exec_catchpoint (PIDGET (inferior_ptid));
+ target_insert_exec_catchpoint (PIDGET (inferior_ptid));
break;
default:
internal_error (__FILE__, __LINE__, "unknown breakpoint type");
break;
}
-
- if (val < 0)
- throw_reason (RETURN_ERROR);
}
/* Helper routine: free the value chain for a breakpoint (watchpoint). */
Index: inf-child.c
===================================================================
RCS file: /cvs/src/src/gdb/inf-child.c,v
retrieving revision 1.4
diff -p -u -r1.4 inf-child.c
--- inf-child.c 29 Sep 2004 15:33:02 -0000 1.4
+++ inf-child.c 18 Jan 2005 16:51:11 -0000
@@ -90,12 +90,11 @@ inf_child_acknowledge_created_inferior (
created inferior" operation by a debugger. */
}
-static int
+static void
inf_child_insert_fork_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of fork
events. */
- return 0;
}
static int
@@ -106,12 +105,11 @@ inf_child_remove_fork_catchpoint (int pi
return 0;
}
-static int
+static void
inf_child_insert_vfork_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of vfork
events. */
- return 0;
}
static int
@@ -130,12 +128,11 @@ inf_child_follow_fork (int follow_child)
return 0;
}
-static int
+static void
inf_child_insert_exec_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of exec
events. */
- return 0;
}
static int
Index: inftarg.c
===================================================================
RCS file: /cvs/src/src/gdb/inftarg.c,v
retrieving revision 1.37
diff -p -u -r1.37 inftarg.c
--- inftarg.c 26 Dec 2004 23:24:26 -0000 1.37
+++ inftarg.c 18 Jan 2005 16:51:11 -0000
@@ -364,11 +364,11 @@ child_acknowledge_created_inferior (int
#if !defined(CHILD_INSERT_FORK_CATCHPOINT)
-int
+void
child_insert_fork_catchpoint (int pid)
{
- /* This version of Unix doesn't support notification of fork events. */
- return 0;
+ /* This version of Unix doesn't support notification of fork
+ events. */
}
#endif
@@ -382,11 +382,11 @@ child_remove_fork_catchpoint (int pid)
#endif
#if !defined(CHILD_INSERT_VFORK_CATCHPOINT)
-int
+void
child_insert_vfork_catchpoint (int pid)
{
- /* This version of Unix doesn't support notification of vfork events. */
- return 0;
+ /* This version of Unix doesn't support notification of vfork
+ events. */
}
#endif
@@ -409,11 +409,11 @@ child_follow_fork (int follow_child)
#endif
#if !defined(CHILD_INSERT_EXEC_CATCHPOINT)
-int
+void
child_insert_exec_catchpoint (int pid)
{
- /* This version of Unix doesn't support notification of exec events. */
- return 0;
+ /* This version of Unix doesn't support notification of exec
+ events. */
}
#endif
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.18
diff -p -u -r1.18 linux-nat.c
--- linux-nat.c 4 Dec 2004 17:21:26 -0000 1.18
+++ linux-nat.c 18 Jan 2005 16:51:11 -0000
@@ -521,31 +521,25 @@ linux_handle_extended_wait (int pid, int
}
-int
+void
child_insert_fork_catchpoint (int pid)
{
if (! linux_supports_tracefork (pid))
error ("Your system does not support fork catchpoints.");
-
- return 0;
}
-int
+void
child_insert_vfork_catchpoint (int pid)
{
if (!linux_supports_tracefork (pid))
error ("Your system does not support vfork catchpoints.");
-
- return 0;
}
-int
+void
child_insert_exec_catchpoint (int pid)
{
if (!linux_supports_tracefork (pid))
error ("Your system does not support exec catchpoints.");
-
- return 0;
}
void
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.90
diff -p -u -r1.90 target.c
--- target.c 8 Oct 2004 20:29:55 -0000 1.90
+++ target.c 18 Jan 2005 16:51:11 -0000
@@ -566,13 +566,13 @@ update_current_target (void)
(void (*) (int))
target_ignore);
de_fault (to_insert_fork_catchpoint,
- (int (*) (int))
+ (void (*) (int))
tcomplain);
de_fault (to_remove_fork_catchpoint,
(int (*) (int))
tcomplain);
de_fault (to_insert_vfork_catchpoint,
- (int (*) (int))
+ (void (*) (int))
tcomplain);
de_fault (to_remove_vfork_catchpoint,
(int (*) (int))
@@ -581,7 +581,7 @@ update_current_target (void)
(int (*) (int))
target_ignore);
de_fault (to_insert_exec_catchpoint,
- (int (*) (int))
+ (void (*) (int))
tcomplain);
de_fault (to_remove_exec_catchpoint,
(int (*) (int))
@@ -2257,17 +2257,13 @@ debug_to_acknowledge_created_inferior (i
pid);
}
-static int
+static void
debug_to_insert_fork_catchpoint (int pid)
{
- int retval;
-
- retval = debug_target.to_insert_fork_catchpoint (pid);
+ debug_target.to_insert_fork_catchpoint (pid);
- fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d) = %d\n",
- pid, retval);
-
- return retval;
+ fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d)\n",
+ pid);
}
static int
@@ -2283,17 +2279,13 @@ debug_to_remove_fork_catchpoint (int pid
return retval;
}
-static int
+static void
debug_to_insert_vfork_catchpoint (int pid)
{
- int retval;
+ debug_target.to_insert_vfork_catchpoint (pid);
- retval = debug_target.to_insert_vfork_catchpoint (pid);
-
- fprintf_unfiltered (gdb_stdlog, "target_insert_vfork_catchpoint (%d)= %d\n",
- pid, retval);
-
- return retval;
+ fprintf_unfiltered (gdb_stdlog, "target_insert_vfork_catchpoint (%d)\n",
+ pid);
}
static int
@@ -2320,17 +2312,13 @@ debug_to_follow_fork (int follow_child)
return retval;
}
-static int
+static void
debug_to_insert_exec_catchpoint (int pid)
{
- int retval;
-
- retval = debug_target.to_insert_exec_catchpoint (pid);
-
- fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d) = %d\n",
- pid, retval);
+ debug_target.to_insert_exec_catchpoint (pid);
- return retval;
+ fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d)\n",
+ pid);
}
static int
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.66
diff -p -u -r1.66 target.h
--- target.h 24 Dec 2004 22:54:02 -0000 1.66
+++ target.h 18 Jan 2005 16:51:11 -0000
@@ -358,12 +358,12 @@ struct target_ops
void (*to_create_inferior) (char *, char *, char **, int);
void (*to_post_startup_inferior) (ptid_t);
void (*to_acknowledge_created_inferior) (int);
- int (*to_insert_fork_catchpoint) (int);
+ void (*to_insert_fork_catchpoint) (int);
int (*to_remove_fork_catchpoint) (int);
- int (*to_insert_vfork_catchpoint) (int);
+ void (*to_insert_vfork_catchpoint) (int);
int (*to_remove_vfork_catchpoint) (int);
int (*to_follow_fork) (int);
- int (*to_insert_exec_catchpoint) (int);
+ void (*to_insert_exec_catchpoint) (int);
int (*to_remove_exec_catchpoint) (int);
int (*to_reported_exec_events_per_exec_call) (void);
int (*to_has_exited) (int, int, int *);
@@ -571,11 +571,11 @@ extern void child_post_startup_inferior
extern void child_acknowledge_created_inferior (int);
-extern int child_insert_fork_catchpoint (int);
+extern void child_insert_fork_catchpoint (int);
extern int child_remove_fork_catchpoint (int);
-extern int child_insert_vfork_catchpoint (int);
+extern void child_insert_vfork_catchpoint (int);
extern int child_remove_vfork_catchpoint (int);
@@ -583,7 +583,7 @@ extern void child_acknowledge_created_in
extern int child_follow_fork (int);
-extern int child_insert_exec_catchpoint (int);
+extern void child_insert_exec_catchpoint (int);
extern int child_remove_exec_catchpoint (int);