From 0af33410304a4123e9fcc85a1f60a27d121f4719 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 18 Jan 2005 17:04:28 +0000 Subject: [PATCH] 2005-01-18 Andrew Cagney * 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. --- gdb/ChangeLog | 20 ++++++++++++++++++++ gdb/breakpoint.c | 9 +++------ gdb/inf-child.c | 9 +++------ gdb/inftarg.c | 18 +++++++++--------- gdb/linux-nat.c | 12 +++--------- gdb/target.c | 42 +++++++++++++++--------------------------- gdb/target.h | 12 ++++++------ 7 files changed, 59 insertions(+), 63 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eaba387687..0f3cd0a871 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,25 @@ 2005-01-18 Andrew Cagney + * 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. + * remote.c (remote_open_1): Use throw_exception. 2005-01-17 Michael Snyder diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 690ec5d218..3c0e8856d7 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -718,21 +718,18 @@ insert_catchpoint (struct ui_out *uo, void *args) 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). */ diff --git a/gdb/inf-child.c b/gdb/inf-child.c index ebc6c6243d..b0d9c6996f 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -90,12 +90,11 @@ inf_child_acknowledge_created_inferior (int pid) 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 pid) 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 diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 2c5de8f40f..2f04365f89 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -364,11 +364,11 @@ child_acknowledge_created_inferior (int pid) #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 diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index a6f389e5b2..6cee9c84d7 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -521,31 +521,25 @@ linux_handle_extended_wait (int pid, int status, } -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 diff --git a/gdb/target.c b/gdb/target.c index 81389a778f..bade14c73c 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -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 (int pid) pid); } -static int +static void debug_to_insert_fork_catchpoint (int pid) { - int retval; - - retval = debug_target.to_insert_fork_catchpoint (pid); - - fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d) = %d\n", - pid, retval); + debug_target.to_insert_fork_catchpoint (pid); - 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; - - retval = debug_target.to_insert_vfork_catchpoint (pid); - - fprintf_unfiltered (gdb_stdlog, "target_insert_vfork_catchpoint (%d)= %d\n", - pid, retval); + debug_target.to_insert_vfork_catchpoint (pid); - 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; + debug_target.to_insert_exec_catchpoint (pid); - retval = debug_target.to_insert_exec_catchpoint (pid); - - fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d) = %d\n", - pid, retval); - - return retval; + fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d)\n", + pid); } static int diff --git a/gdb/target.h b/gdb/target.h index a7016bd79f..9665ade58c 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -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 (ptid_t); 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_inferior (int); 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); -- 2.11.0