From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10008 invoked by alias); 15 Sep 2008 18:33:54 -0000 Received: (qmail 9999 invoked by uid 22791); 15 Sep 2008 18:33:53 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 15 Sep 2008 18:33:19 +0000 Received: from mailhost5.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id B047523002; Mon, 15 Sep 2008 11:33:16 -0700 (PDT) Received: from [10.20.92.218] (promb-2s-dhcp218.eng.vmware.com [10.20.92.218]) by mailhost5.vmware.com (Postfix) with ESMTP id A56A1DC07D; Mon, 15 Sep 2008 11:33:16 -0700 (PDT) Message-ID: <48CEAA05.8050006@vmware.com> Date: Mon, 15 Sep 2008 18:33:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , teawater Subject: [reverse RFA] no singlestep-over-BP in reverse Content-Type: multipart/mixed; boundary="------------040608030508040909020207" 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-09/txt/msg00336.txt.bz2 This is a multi-part message in MIME format. --------------040608030508040909020207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 452 When we're stopped at a breakpoint and we want to continue in reverse, we're not actually going to execute the instruction at the breakpoint -- we're going to de-execute the previous instruction. Therefore there's no need to singlestep before inserting breakpoints. In fact it would be a bad idea to do so, because if there is a breakpoint at the previous instruction, we WANT to hit it. Note that this patch is to be applied to the reverse branch. --------------040608030508040909020207 Content-Type: text/plain; name="bpstep.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bpstep.txt" Content-length: 1217 2008-09-15 Michael Snyder * infrun.c (proceed): No need to singlestep over a breakpoint when resuming in reverse. Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.300.2.5 diff -u -p -r1.300.2.5 infrun.c --- infrun.c 5 Sep 2008 03:37:10 -0000 1.300.2.5 +++ infrun.c 15 Sep 2008 18:28:29 -0000 @@ -1226,11 +1226,17 @@ proceed (CORE_ADDR addr, enum target_sig if (addr == (CORE_ADDR) -1) { - if (pc == stop_pc && breakpoint_here_p (pc)) + if (pc == stop_pc && breakpoint_here_p (pc) + && target_get_execution_direction () == EXEC_FORWARD) /* There is a breakpoint at the address we will resume at, step one instruction before inserting breakpoints so that we do not stop right away (and report a second hit at this - breakpoint). */ + breakpoint). + + Note, we don't do this in reverse, because we won't + actually be executing the breakpoint insn anyway. + We'll be (un-)executing the previous instruction. */ + oneproc = 1; else if (gdbarch_single_step_through_delay_p (gdbarch) && gdbarch_single_step_through_delay (gdbarch, --------------040608030508040909020207--