Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [reverse RFA] no singlestep-over-BP in reverse
@ 2008-09-15 18:33 Michael Snyder
  2008-09-15 18:43 ` Daniel Jacobowitz
  2008-09-16  4:22 ` teawater
  0 siblings, 2 replies; 23+ messages in thread
From: Michael Snyder @ 2008-09-15 18:33 UTC (permalink / raw)
  To: gdb-patches, teawater

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

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.

[-- Attachment #2: bpstep.txt --]
[-- Type: text/plain, Size: 1217 bytes --]

2008-09-15  Michael Snyder  <msnyder@vmware.com>

	* 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,

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-09-18  6:39 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-15 18:33 [reverse RFA] no singlestep-over-BP in reverse Michael Snyder
2008-09-15 18:43 ` Daniel Jacobowitz
2008-09-15 19:07   ` Michael Snyder
2008-09-15 21:15     ` Daniel Jacobowitz
2008-09-15 23:09       ` Michael Snyder
2008-09-16  0:09   ` Michael Snyder
2008-09-16  4:13   ` teawater
     [not found]   ` <daef60380809152110u663350abx76b283d519c5a09d@mail.gmail.com>
2008-09-16 18:40     ` Michael Snyder
2008-09-16  4:22 ` teawater
2008-09-16 15:04   ` teawater
2008-09-16 15:14     ` teawater
2008-09-16 15:22     ` Daniel Jacobowitz
2008-09-16 15:34       ` teawater
2008-09-16 15:35       ` teawater
2008-09-16 18:50       ` Michael Snyder
2008-09-16 18:45   ` Michael Snyder
2008-09-16 20:11     ` Joel Brobecker
2008-09-17  0:56       ` Michael Snyder
2008-09-17 15:44         ` teawater
2008-09-17 18:18           ` Michael Snyder
2008-09-17 15:32     ` teawater
2008-09-17 18:16       ` Michael Snyder
2008-09-18  6:39         ` teawater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox