From patchwork Wed Mar 11 14:39:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 5577 Received: (qmail 117052 invoked by alias); 11 Mar 2015 14:40:05 -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 116925 invoked by uid 89); 11 Mar 2015 14:40:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham 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; Wed, 11 Mar 2015 14:40:03 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2BEe1bu020703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 11 Mar 2015 10:40:01 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2BEdwDN006029 for ; Wed, 11 Mar 2015 10:40:01 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 2/4] Make step_start_function be per thread Date: Wed, 11 Mar 2015 14:39:56 +0000 Message-Id: <1426084798-1032-3-git-send-email-palves@redhat.com> In-Reply-To: <1426084798-1032-1-git-send-email-palves@redhat.com> References: <1426084798-1032-1-git-send-email-palves@redhat.com> I noticed that step_start_function is still a global, while it obviously should be a per-thread field. gdb/ChangeLog: 2015-03-11 Pedro Alves * infrun.c (step_start_function): Delete and ... * gdbthread.h (struct thread_control_state) : ... now a field here. * infrun.c (clear_proceed_status_thread): Clear the thread's step_start_function. (proceed, process_event_stop_test, print_stop_event): Adjust. --- gdb/gdbthread.h | 3 +++ gdb/infrun.c | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index e9ae47d..ce4f76f 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -73,6 +73,9 @@ struct thread_control_state CORE_ADDR step_range_start; /* Inclusive */ CORE_ADDR step_range_end; /* Exclusive */ + /* Function the thread was in as of last it started stepping. */ + struct symbol *step_start_function; + /* If GDB issues a target step request, and this is nonzero, the target should single-step this thread once, and then continue single-stepping it without GDB core involvement as long as the diff --git a/gdb/infrun.c b/gdb/infrun.c index ed4ba79..be1cc74 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -326,10 +326,6 @@ update_signals_program_target (void) static struct cmd_list_element *stop_command; -/* Function inferior was in as of last step command. */ - -static struct symbol *step_start_function; - /* Nonzero if we want to give control to the user when we're notified of shared library events by the dynamic linker. */ int stop_on_solib_events; @@ -2409,6 +2405,7 @@ clear_proceed_status_thread (struct thread_info *tp) tp->control.step_frame_id = null_frame_id; tp->control.step_stack_frame_id = null_frame_id; tp->control.step_over_calls = STEP_OVER_UNDEBUGGABLE; + tp->control.step_start_function = NULL; tp->stop_requested = 0; tp->control.stop_step = 0; @@ -2589,7 +2586,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal, int step) tp = inferior_thread (); if (step) - step_start_function = find_pc_function (pc); + tp->control.step_start_function = find_pc_function (pc); /* Fill in with reasonable starting values. */ init_thread_stepping_state (tp); @@ -5171,7 +5168,8 @@ process_event_stop_test (struct execution_control_state *ecs) ecs->event_thread->control.step_stack_frame_id) && (!frame_id_eq (ecs->event_thread->control.step_stack_frame_id, outer_frame_id) - || step_start_function != find_pc_function (stop_pc)))) + || (ecs->event_thread->control.step_start_function + != find_pc_function (stop_pc))))) { CORE_ADDR real_stop_pc; @@ -6444,7 +6442,7 @@ print_stop_event (struct target_waitstatus *ws) if (tp->control.stop_step && frame_id_eq (tp->control.step_frame_id, get_frame_id (get_current_frame ())) - && step_start_function == find_pc_function (stop_pc)) + && tp->control.step_start_function == find_pc_function (stop_pc)) { /* Finished step, just print source line. */ source_flag = SRC_LINE;