From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2478 invoked by alias); 5 Dec 2008 22:43:53 -0000 Received: (qmail 2470 invoked by uid 22791); 5 Dec 2008 22:43:52 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Dec 2008 22:43:17 +0000 Received: (qmail 22120 invoked from network); 5 Dec 2008 22:43:15 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Dec 2008 22:43:15 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Set the stepping range from the function@PC, not@stop_pc. Date: Fri, 05 Dec 2008 22:43:00 -0000 User-Agent: KMail/1.9.10 Cc: Daniel Jacobowitz , Ulrich Weigand References: <200812051946.06793.pedro@codesourcery.com> <200812052030.mB5KUcjR012062@d12av02.megacenter.de.ibm.com> <20081205204328.GA4373@caradoc.them.org> In-Reply-To: <20081205204328.GA4373@caradoc.them.org> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_B6aOJwmALVhoiPs" Message-Id: <200812052243.13753.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00105.txt.bz2 --Boundary-00=_B6aOJwmALVhoiPs Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 557 On Friday 05 December 2008 20:43:28, Daniel Jacobowitz wrote: > On Fri, Dec 05, 2008 at 09:30:38PM +0100, Ulrich Weigand wrote: > > > I think it's obvious after the discussion, but I'd still like to > > > have your approval. OK? Any objections? > > > > It might be better to use get_frame_pc (frame) instead of read_pc (), > > Yes, please. > Good idea. I wonder if this I've checked this in then. There are two other instances of read_pc in infcmd.c that could use the same idiom --- I guess these calls predate the sentinel frame. -- Pedro Alves --Boundary-00=_B6aOJwmALVhoiPs Content-Type: text/x-diff; charset="iso 8859-15"; name="step_func_pc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="step_func_pc.diff" Content-length: 1706 2008-12-05 Pedro Alves * infcmd.c (step_1, step_once): Look up the stepping range based on the current frame's PC, not on stop_pc. --- gdb/infcmd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) Index: src/gdb/infcmd.c =================================================================== --- src.orig/gdb/infcmd.c 2008-12-05 20:03:59.000000000 +0000 +++ src/gdb/infcmd.c 2008-12-05 21:42:56.000000000 +0000 @@ -812,12 +812,15 @@ step_1 (int skip_subroutines, int single if (!single_inst) { - find_pc_line_pc_range (stop_pc, + CORE_ADDR pc; + + pc = get_frame_pc (frame); + find_pc_line_pc_range (pc, &tp->step_range_start, &tp->step_range_end); if (tp->step_range_end == 0) { char *name; - if (find_pc_partial_function (stop_pc, &name, + if (find_pc_partial_function (pc, &name, &tp->step_range_start, &tp->step_range_end) == 0) error (_("Cannot find bounds of current function")); @@ -932,7 +935,10 @@ step_once (int skip_subroutines, int sin if (!single_inst) { - find_pc_line_pc_range (stop_pc, + CORE_ADDR pc; + + pc = get_frame_pc (frame); + find_pc_line_pc_range (pc, &tp->step_range_start, &tp->step_range_end); /* If we have no line info, switch to stepi mode. */ @@ -943,7 +949,7 @@ step_once (int skip_subroutines, int sin else if (tp->step_range_end == 0) { char *name; - if (find_pc_partial_function (stop_pc, &name, + if (find_pc_partial_function (pc, &name, &tp->step_range_start, &tp->step_range_end) == 0) error (_("Cannot find bounds of current function")); --Boundary-00=_B6aOJwmALVhoiPs--