From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5244 invoked by alias); 5 Dec 2008 23:37:31 -0000 Received: (qmail 5236 invoked by uid 22791); 5 Dec 2008 23:37:30 -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 23:36:55 +0000 Received: (qmail 18755 invoked from network); 5 Dec 2008 23:36:53 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Dec 2008 23:36:53 -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 23:37:00 -0000 User-Agent: KMail/1.9.10 Cc: Daniel Jacobowitz , Ulrich Weigand References: <200812051946.06793.pedro@codesourcery.com> <20081205204328.GA4373@caradoc.them.org> <200812052243.13753.pedro@codesourcery.com> In-Reply-To: <200812052243.13753.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_UsbOJMDbffsQl57" Message-Id: <200812052336.52427.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/msg00106.txt.bz2 --Boundary-00=_UsbOJMDbffsQl57 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 344 On Friday 05 December 2008 22:43:13, Pedro Alves wrote: > 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. Might as well be consistent. Tested on x86-64-unknown-linux-gnu. OK? -- Pedro Alves --Boundary-00=_UsbOJMDbffsQl57 Content-Type: text/x-diff; charset="iso 8859-15"; name="get_frame_pc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="get_frame_pc.diff" Content-length: 1513 2008-12-05 Pedro Alves * infcmd.c (until_next_command, finish_backward): Use get_frame_pc instead of read_pc. --- gdb/infcmd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) Index: src/gdb/infcmd.c =================================================================== --- src.orig/gdb/infcmd.c 2008-12-05 23:02:12.000000000 +0000 +++ src/gdb/infcmd.c 2008-12-05 23:19:21.000000000 +0000 @@ -1181,7 +1181,7 @@ until_next_command (int from_tty) than the current line (if in symbolic section) or pc (if not). */ - pc = read_pc (); + pc = get_frame_pc (frame); func = find_pc_function (pc); if (!func) @@ -1405,11 +1405,13 @@ finish_backward (struct symbol *function struct thread_info *tp = inferior_thread (); struct breakpoint *breakpoint; struct cleanup *old_chain; + CORE_ADDR pc; CORE_ADDR func_addr; int back_up; - if (find_pc_partial_function (get_frame_pc (get_current_frame ()), - NULL, &func_addr, NULL) == 0) + pc = get_frame_pc (get_current_frame ()); + + if (find_pc_partial_function (pc, NULL, &func_addr, NULL) == 0) internal_error (__FILE__, __LINE__, _("Finish: couldn't find function.")); @@ -1426,7 +1428,7 @@ finish_backward (struct symbol *function no way that a function up the stack can have a return address that's equal to its entry point. */ - if (sal.pc != read_pc ()) + if (sal.pc != pc) { /* Set breakpoint and continue. */ breakpoint = --Boundary-00=_UsbOJMDbffsQl57--