From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14580 invoked by alias); 8 Apr 2013 14:47:34 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 14569 invoked by uid 89); 8 Apr 2013 14:47:34 -0000 X-Spam-SWARE-Status: No, score=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 08 Apr 2013 14:47:33 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r38ElVPj026796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Apr 2013 10:47:31 -0400 Received: from host2.jankratochvil.net (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r38ElQwn025335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 8 Apr 2013 10:47:29 -0400 Date: Mon, 08 Apr 2013 14:47:00 -0000 From: Jan Kratochvil To: ishare Cc: gdb@sourceware.org Subject: Re: reverse execution Message-ID: <20130408144725.GA19422@host2.jankratochvil.net> References: <20130408143437.GA13810@debian.localdomain> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: <20130408143437.GA13810@debian.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Found: No X-IsSubscribed: yes X-SW-Source: 2013-04/txt/msg00019.txt.bz2 --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 2596 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 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: ... 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) --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="nops.S" Content-length: 67 _start: .globl _start nop nop nop nop nop nop nop nop nop nop int3 --OwLcNYc0lM97+oe1--