This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB MI Reverse Commands added [3 of 3]
- From: Hui Zhu <teawater at gmail dot com>
- To: Jakob Engblom <jakob at virtutech dot com>
- Cc: Vladimir Prus <vladimir at codesourcery dot com>, gdb-patches at sources dot redhat dot com, Michael Snyder <msnyder at vmware dot com>
- Date: Mon, 7 Sep 2009 09:43:46 +0800
- Subject: Re: GDB MI Reverse Commands added [3 of 3]
- References: <00d001ca265a$ddd0c800$99725800$@com> <h7la0n$uvt$1@ger.gmane.org> <018401ca2cc6$7c2581a0$747084e0$@com>
On Fri, Sep 4, 2009 at 02:43, Jakob Engblom<jakob@virtutech.com> wrote:
>> The file should be called mi-reverse.exp, I think, because mi2- files are
>> supposed to test
>> that whatever was once announced as MI2 is not broken. And this is new
>> development. Likewise,
>
> Done.
>
>> ? ? ? ? set MIFLAGS "-i=mi2"
>>
>> should be:
>>
>> ? ? ? ? set MIFLAGS "-i=mi"
>
> Done.
>
>> Also, I would appreciate if this:
>>
>> ? ? # Test exec-reverse-next
>> ? ? # FIXME: Why does it take 2 next commands to get back to the
>> ? ? # ? ? ? ?previous line?
>>
>> were somehow addressed. I am not familiar with details of reverse behaviour,
> so I
>> did not even try to check that the tested commands and locations, etc, are
> right.
>
> Since this is tested on top of process record, I think I am not the best person
> to answer... but in general, what tends to happen in reverse in my experience is
> this:
>
> We have lines of code (or instructions)
>
> A
> B
>
> And we stop with a breakpoint in line B.
>
> We are then at the end of B, or in the middle of B, in the execution.
>
> Then, doing reverse one step/instruction/line will move you to the start of B.
>
> And another step/instruction/line moves you to before A was executed.
>
> Does that make sense for process record?
I am not sure. Let me talk what I think about it.
The instruction is:
A
B
When inferior stop at B by breakpoint of line.
We are in the begin of B.
GDB will show we are in B.
A
<----------- This is inferior at. PC is point to B.
B
reverse-stepi
We are in the begin of A.
GDB will show we are in A.
<----------- This is inferior at. PC is point to A.
A
B
Thanks,
Hui