From patchwork Fri May 8 20:21:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 6645 Received: (qmail 78378 invoked by alias); 8 May 2015 20:21:57 -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 78311 invoked by uid 89); 8 May 2015 20:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 May 2015 20:21:55 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 449E951 for ; Fri, 8 May 2015 20:21:54 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t48KLqft028190 for ; Fri, 8 May 2015 16:21:53 -0400 Subject: [PATCH 5/6] Remove stop_registers From: Jan Kratochvil To: gdb-patches@sourceware.org Date: Fri, 08 May 2015 22:21:52 +0200 Message-ID: <20150508202152.15830.73823.stgit@host1.jankratochvil.net> In-Reply-To: <20150508202119.15830.18218.stgit@host1.jankratochvil.net> References: <20150508202119.15830.18218.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes Hi, now stop_registers are no longer used and it can be removed. I am not much sure what 'proceed_to_finish' really means now so I make a wild guess while updating comments about it. Jan gdb/ChangeLog 2015-05-08 Jan Kratochvil * gdbthread.h (struct thread_control_state): Update comment for proceed_to_finish. * infcall.c (run_inferior_call): Update comment about proceed_to_finish. * infcmd.c (get_return_value): Update comment about stop_registers. (finish_forward): Update comment about proceed_to_finish. * infrun.c (stop_registers): Remove. (clear_proceed_status, normal_stop): Remove stop_registers handling. * infrun.h (stop_registers): Remove. --- gdb/gdbthread.h | 2 +- gdb/infcall.c | 2 +- gdb/infcmd.c | 4 ++-- gdb/infrun.c | 27 --------------------------- gdb/infrun.h | 7 ------- 5 files changed, 4 insertions(+), 38 deletions(-) diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index ff7cec2..0926f5f 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -118,7 +118,7 @@ struct thread_control_state int trap_expected; /* Nonzero if the thread is being proceeded for a "finish" command - or a similar situation when stop_registers should be saved. */ + or a similar situation when return value should be printed. */ int proceed_to_finish; /* Nonzero if the thread is being proceeded for an inferior function diff --git a/gdb/infcall.c b/gdb/infcall.c index 9707861..849f500 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -398,7 +398,7 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc) disable_watchpoints_before_interactive_call_start (); - /* We want stop_registers, please... */ + /* We want to print return value, please... */ call_thread->control.proceed_to_finish = 1; TRY diff --git a/gdb/infcmd.c b/gdb/infcmd.c index f8874d3..5df8e0f 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1519,7 +1519,7 @@ get_return_value (struct value *function, struct type *value_type, struct value *value; struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); - /* If stop_registers were not saved, use the current registers. */ + /* If were not saved, use the current registers. */ if (dtor_data != NULL) stop_regs = call_function_by_hand_dtor_get (dtor_data); else @@ -1786,7 +1786,7 @@ finish_forward (struct symbol *function, struct frame_info *frame) set_longjmp_breakpoint (tp, frame_id); make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); - /* We want stop_registers, please... */ + /* We want to print return value, please... */ tp->control.proceed_to_finish = 1; cargs = xmalloc (sizeof (*cargs)); diff --git a/gdb/infrun.c b/gdb/infrun.c index a4f0b9f..71cf208 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -353,13 +353,6 @@ show_stop_on_solib_events (struct ui_file *file, int from_tty, int stop_after_trap; -/* Save register contents here when executing a "finish" command or are - about to pop a stack dummy frame, if-and-only-if proceed_to_finish is set. - Thus this contains the return value from the called function (assuming - values are returned in a register). */ - -struct regcache *stop_registers; - /* Nonzero after stop if current stack frame should be printed. */ static int stop_print_frame; @@ -2505,12 +2498,6 @@ clear_proceed_status (int step) clear_step_over_info (); observer_notify_about_to_proceed (); - - if (stop_registers) - { - regcache_xfree (stop_registers); - stop_registers = NULL; - } } /* Returns true if TP is still stopped at a breakpoint that needs @@ -6697,20 +6684,6 @@ normal_stop (void) print_stop_event (&last); } - /* Save the function value return registers, if we care. - We might be about to restore their previous contents. */ - if (inferior_thread ()->control.proceed_to_finish - && execution_direction != EXEC_REVERSE) - { - /* This should not be necessary. */ - if (stop_registers) - regcache_xfree (stop_registers); - - /* NB: The copy goes through to the target picking up the value of - all the registers. */ - stop_registers = regcache_dup (get_current_regcache ()); - } - if (stop_stack_dummy == STOP_STACK_DUMMY) { /* Pop the empty frame that contains the stack dummy. diff --git a/gdb/infrun.h b/gdb/infrun.h index 1f09e41..75bb075 100644 --- a/gdb/infrun.h +++ b/gdb/infrun.h @@ -73,13 +73,6 @@ enum exec_direction_kind compatible with make_cleanup_restore_integer. */ extern int execution_direction; -/* Save register contents here when executing a "finish" command or - are about to pop a stack dummy frame, if-and-only-if - proceed_to_finish is set. Thus this contains the return value from - the called function (assuming values are returned in a - register). */ -extern struct regcache *stop_registers; - extern void start_remote (int from_tty); /* Clear out all variables saying what to do when inferior is