Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: ishare <june.tune.sea@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: reverse execution
Date: Mon, 08 Apr 2013 14:47:00 -0000	[thread overview]
Message-ID: <20130408144725.GA19422@host2.jankratochvil.net> (raw)
In-Reply-To: <20130408143437.GA13810@debian.localdomain>

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

On Mon, 08 Apr 2013 16:34:37 +0200, ishare wrote:
> I record at 0x40000000 , then I nexti 10 instructions , then I want reverse execute 
> these 10 instructions one by one, So I type reverse-nexti ,but unexpectly ,gdb directly
> goes back to the addresss 0x40000000 ,where I start record .
> 
> What I need is 10->9->8->7->6->5->4->3->2->1 ,not execute again from begin to end .

It is safer during troubleshooting to use *stepi instead of *nexti (where
there is no difference as there is no call instruction).

It works for me with 7.5.1 so it would be needed to have a reproducer.

Additionally there ware some 7.6 (pre-release available now) fixes to these
issues but it should not affect this case as long as there are no calls.


Regards,
Jan


GNU gdb (GDB) 7.5.1.20130125-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jkratoch/t/nops...done.
(gdb) disas _start
Dump of assembler code for function _start:
   0x00000000004000d4 <+0>:	nop
   0x00000000004000d5 <+1>:	nop
   0x00000000004000d6 <+2>:	nop
   0x00000000004000d7 <+3>:	nop
   0x00000000004000d8 <+4>:	nop
   0x00000000004000d9 <+5>:	nop
   0x00000000004000da <+6>:	nop
   0x00000000004000db <+7>:	nop
   0x00000000004000dc <+8>:	nop
   0x00000000004000dd <+9>:	nop
   0x00000000004000de <+10>:	int3   
End of assembler dump.
(gdb) info files 
Symbols from "/home/jkratoch/t/nops".
Local exec file:
	`/home/jkratoch/t/nops', file type elf64-x86-64.
	Entry point: 0x4000d4
	0x00000000004000b0 - 0x00000000004000d4 is .note.gnu.build-id
	0x00000000004000d4 - 0x00000000004000df is .text
(gdb) b *0x4000d4
Breakpoint 1 at 0x4000d4: file nops.S, line 2.
(gdb) r
Starting program: /home/jkratoch/t/nops 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffd000

Breakpoint 1, _start () at nops.S:2
2	nop
(gdb) record 
(gdb) nexti
3	nop
(gdb) 
4	nop
(gdb) 
5	nop
(gdb) 
6	nop
(gdb) 
7	nop
(gdb) 
8	nop
(gdb) 
9	nop
(gdb) 
10	nop
(gdb) 
11	nop
(gdb) 
12	int3
(gdb) reverse-nexti
11	nop
(gdb) 
10	nop
(gdb) 
9	nop
(gdb) 
8	nop
(gdb) 
7	nop
(gdb) 
6	nop
(gdb) 
5	nop
(gdb) 
4	nop
(gdb) 
3	nop
(gdb) 

No more reverse-execution history.
_start () at nops.S:2
2	nop
(gdb) 

[-- Attachment #2: nops.S --]
[-- Type: text/plain, Size: 67 bytes --]

_start: .globl _start
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
int3

  reply	other threads:[~2013-04-08 14:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 14:37 ishare
2013-04-08 14:47 ` Jan Kratochvil [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-10-16 21:07 burlen
2009-10-16 21:55 ` Michael Snyder
2009-10-17 23:49   ` Daniel Jacobowitz
2009-10-18  2:19 ` Jiang Jilin
2009-10-18  3:18   ` Hui Zhu
2009-10-18  4:01     ` Jiang Jilin
2009-10-18 11:18       ` Michael Snyder
2009-10-19  8:04         ` Hui Zhu

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=20130408144725.GA19422@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=june.tune.sea@gmail.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