From patchwork Thu Apr 12 16:42:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 26692 Received: (qmail 6175 invoked by alias); 12 Apr 2018 16:43:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 6164 invoked by uid 89); 12 Apr 2018 16:42:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Apr 2018 16:42:58 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F10640252F0 for ; Thu, 12 Apr 2018 16:42:57 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD2242141212 for ; Thu, 12 Apr 2018 16:42:56 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed/ob] Eliminate target_has_exited Date: Thu, 12 Apr 2018 17:42:55 +0100 Message-Id: <20180412164255.23500-1-palves@redhat.com> Nothing uses this. gdb/ChangeLog: 2018-04-12 Pedro Alves * target.h (target_ops::to_has_exited): Delete. (target_has_exited): Delete. * target-delegates.c: Regenerate. --- gdb/ChangeLog | 6 ++++++ gdb/target-delegates.c | 37 ------------------------------------- gdb/target.h | 9 --------- 3 files changed, 6 insertions(+), 46 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 04754ac2ef..a05520fb7c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-04-12 Pedro Alves + + * target.h (target_ops::to_has_exited): Delete. + (target_has_exited): Delete. + * target-delegates.c: Regenerate. + 2018-04-11 Pedro Alves * target.c (fileio_fh_t::t): Add comment. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 9521240efd..6ff3e06cc8 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -1342,39 +1342,6 @@ debug_set_syscall_catchpoint (struct target_ops *self, int arg1, bool arg2, int return result; } -static int -delegate_has_exited (struct target_ops *self, int arg1, int arg2, int *arg3) -{ - self = self->beneath; - return self->to_has_exited (self, arg1, arg2, arg3); -} - -static int -tdefault_has_exited (struct target_ops *self, int arg1, int arg2, int *arg3) -{ - return 0; -} - -static int -debug_has_exited (struct target_ops *self, int arg1, int arg2, int *arg3) -{ - int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->to_has_exited (...)\n", debug_target.to_shortname); - result = debug_target.to_has_exited (&debug_target, arg1, arg2, arg3); - fprintf_unfiltered (gdb_stdlog, "<- %s->to_has_exited (", debug_target.to_shortname); - target_debug_print_struct_target_ops_p (&debug_target); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int (arg1); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int (arg2); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int_p (arg3); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_int (result); - fputs_unfiltered ("\n", gdb_stdlog); - return result; -} - static void delegate_mourn_inferior (struct target_ops *self) { @@ -4271,8 +4238,6 @@ install_delegators (struct target_ops *ops) ops->to_follow_exec = delegate_follow_exec; if (ops->to_set_syscall_catchpoint == NULL) ops->to_set_syscall_catchpoint = delegate_set_syscall_catchpoint; - if (ops->to_has_exited == NULL) - ops->to_has_exited = delegate_has_exited; if (ops->to_mourn_inferior == NULL) ops->to_mourn_inferior = delegate_mourn_inferior; if (ops->to_can_run == NULL) @@ -4537,7 +4502,6 @@ install_dummy_methods (struct target_ops *ops) ops->to_remove_exec_catchpoint = tdefault_remove_exec_catchpoint; ops->to_follow_exec = tdefault_follow_exec; ops->to_set_syscall_catchpoint = tdefault_set_syscall_catchpoint; - ops->to_has_exited = tdefault_has_exited; ops->to_mourn_inferior = default_mourn_inferior; ops->to_can_run = tdefault_can_run; ops->to_pass_signals = tdefault_pass_signals; @@ -4697,7 +4661,6 @@ init_debug_target (struct target_ops *ops) ops->to_remove_exec_catchpoint = debug_remove_exec_catchpoint; ops->to_follow_exec = debug_follow_exec; ops->to_set_syscall_catchpoint = debug_set_syscall_catchpoint; - ops->to_has_exited = debug_has_exited; ops->to_mourn_inferior = debug_mourn_inferior; ops->to_can_run = debug_can_run; ops->to_pass_signals = debug_pass_signals; diff --git a/gdb/target.h b/gdb/target.h index d7580ace63..f208b10767 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -597,8 +597,6 @@ struct target_ops int, bool, int, gdb::array_view) TARGET_DEFAULT_RETURN (1); - int (*to_has_exited) (struct target_ops *, int, int, int *) - TARGET_DEFAULT_RETURN (0); void (*to_mourn_inferior) (struct target_ops *) TARGET_DEFAULT_FUNC (default_mourn_inferior); /* Note that to_can_run is special and can be invoked on an @@ -1624,13 +1622,6 @@ void target_follow_exec (struct inferior *inf, char *execd_pathname); pid, needed, any_count, \ syscall_counts) -/* Returns TRUE if PID has exited. And, also sets EXIT_STATUS to the - exit code of PID, if any. */ - -#define target_has_exited(pid,wait_status,exit_status) \ - (*current_target.to_has_exited) (¤t_target, \ - pid,wait_status,exit_status) - /* The debugger has completed a blocking wait() call. There is now some process event that must be processed. This function should be defined by those targets that require the debugger to perform