From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19668 invoked by alias); 30 Oct 2008 21:21:26 -0000 Received: (qmail 15902 invoked by uid 22791); 30 Oct 2008 21:19:35 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 30 Oct 2008 21:16:24 +0000 Received: from mailhost5.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 070A813027; Thu, 30 Oct 2008 13:01:01 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost5.vmware.com (Postfix) with ESMTP id E85DDDC105; Thu, 30 Oct 2008 13:01:00 -0700 (PDT) Message-ID: <490A110B.809@vmware.com> Date: Thu, 30 Oct 2008 21:29:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" , teawater Subject: Re: [reverse/record] adjust_pc_after_break in reverse execution mode? References: <200810180210.16346.pedro@codesourcery.com> <200810301107.23536.pedro@codesourcery.com> <29E9E827072C404C88A05DDC42B4599717BBECC4E1@PA-EXMBX14.vmware.com> <200810301615.40510.pedro@codesourcery.com> In-Reply-To: <200810301615.40510.pedro@codesourcery.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00704.txt.bz2 OK, I'm with you now. Thanks a lot for clarifying. ;-) Pedro Alves wrote: > On Thursday 30 October 2008 15:54:34, Michael Snyder wrote: >> Pedro, yes, but I can no longer get it to exhibit that behavior. >> Can you? >> > > Sure, see below. > > Head of ChangeLog: > > 2008-10-24 Michael Snyder > > * infrun.c (handle_inferior_event): Handle dynamic symbol > resolution in reverse. > > Test app: > > 18 volatile int global_foo = 0; > 19 > 20 int > 21 main (int argc, char **argv) > 22 { > 23 asm ("nop"); /* 1st insn */ > 24 asm ("nop"); /* 2nd insn */ > 25 asm ("nop"); /* 3rd insn */ > 26 asm ("nop"); /* 4th insn */ > 27 if (!global_foo) > 28 goto ahead; > 29 asm ("nop"); /* 5th insn */ > 30 asm ("nop"); /* 6th insn */ > 31 asm ("nop"); /* 7th insn */ > 32 asm ("nop"); /* 8th insn */ <<<<< bkpt here > 33 ahead: > 34 asm ("nop"); /* 9th insn */ <<<<< and here > 35 end: > 36 return 0; > 37 } > > Normal play: > >> ./gdb ./testsuite/gdb.base/decr-pc-rev > GNU gdb (GDB) 6.8.50.20080930-cvs > [...] > (gdb) start > Temporary breakpoint 1 at 0x8048382: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 23. > Starting program: /home/pedro/gdb/reverse-20080930-branch/build32/gdb/testsuite/gdb.base/decr-pc-rev > > Temporary breakpoint 1, main (argc=, argv=) > at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:23 > 23 asm ("nop"); /* 1st insn */ > (gdb) b 32 > Breakpoint 2 at 0x8048392: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 32. > (gdb) b 34 > Breakpoint 3 at 0x8048393: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 34. > (gdb) c > Continuing. > > Breakpoint 3, main (argc=, argv=) > at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:34 > 34 in ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c > (gdb) p $pc > $1 = (void (*)()) 0x8048393 > (gdb) > > Ok, breakpoint 3 was hit (notice the goto at line 28, it's > always executed because global_foo is always 0) > > -------- > > Now the same, but while recording (replay exhibits the > same symptom) > >> ./gdb ./testsuite/gdb.base/decr-pc-rev > GNU gdb (GDB) 6.8.50.20080930-cvs > [...] > (gdb) start > Temporary breakpoint 1 at 0x8048382: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 23. > Starting program: /home/pedro/gdb/reverse-20080930-branch/build32/gdb/testsuite/gdb.base/decr-pc-rev > > Temporary breakpoint 1, main (argc=, argv=) > at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:23 > 23 asm ("nop"); /* 1st insn */ > (gdb) record > ^^^^^^ > (gdb) c > Continuing. > > Breakpoint 2, main (argc=, argv=) > at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:32 > 32 in ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c > (gdb) p $pc > $1 = (void (*)()) 0x8048392 > (gdb) > > Breakpoint 3 should've been hit, not 2. The PC points at > 0x8048392, but it should point at 0x8048393. > > Feels like we're going in circles. :-) > > -- > Pedro Alves