Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: teawater <teawater@gmail.com>
To: "Michael Snyder" <msnyder@vmware.com>,
	"Daniel Jacobowitz" <drow@false.org>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [reverse RFA] no singlestep-over-BP in reverse
Date: Tue, 16 Sep 2008 15:04:00 -0000	[thread overview]
Message-ID: <daef60380809160803x593029e2oa64556750b0ad3f6@mail.gmail.com> (raw)
In-Reply-To: <daef60380809152121n741b14f0ue69a8456108792b0@mail.gmail.com>

Hi guys,

I think we need to decide the behavior of reverse mode breakpoint.

In forward mode, it's clear that CPU stop in address of breakpoint.
The instruction in this address will not be executed.

In reverse mode, If CPU stop in address of breakpoint, I think we have
2 choices:

1. The instruction in this address already reverse executed, it make
program status back to before forward execute this instruction.
Good for it is:
This way make reverse breakpoint same with simple BP.
If program break in reverse mode and got forward execute command. It
don't need special process.
Bad for it is:
This instruction already reverse executed, I think it's not the
original idea of breakpoint. I think the original idea of breakpoint
is stop the program before the instruction forward and reverse
execute.
And for record and replay type reverse target such as inside record
and gdb-freeplay(Sorry I am not very clear), to implement this BP are
not hard. But maybe not easy for others.

2. The instr in this address will not reverse executed, it make
program status in after forward execute this instruction.
Good for it is:
Maybe this is the original idea of breakpoint.
Bad for it is:
If program break in reverse mode and got forward execute command. It
need special process.
Maybe some reverse target can't support it.

Maybe we need support both of them. Target choice what it want, maybe
both of them. And target need to decide if he want a single step to
jump a BP or not.

How do you think about it?


Thanks,
Hui




On Tue, Sep 16, 2008 at 12:21, teawater <teawater@gmail.com> wrote:
> I think maybe some reverse target (in the future?) need it.
> Someone already know it already deal the breakpoint. But the others
> will not know. Maybe I will change inside record to second type.
>
>
> If this single step affect some target, how about let target choice it
> with itself?
>
> Thanks,
> Hui
>
>
>
>
> On Tue, Sep 16, 2008 at 02:31, Michael Snyder <msnyder@vmware.com> wrote:
>> 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.
>>
>> 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,
>>
>>
>


  reply	other threads:[~2008-09-16 15:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-15 18:33 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=daef60380809160803x593029e2oa64556750b0ad3f6@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox