From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15405 invoked by alias); 21 Jan 2009 18:52:51 -0000 Received: (qmail 15396 invoked by uid 22791); 21 Jan 2009 18:52:50 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12,J_CHICKENPOX_33,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from imr2.ericy.com (HELO imr2.ericy.com) (198.24.6.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Jan 2009 18:52:44 +0000 Received: from eusrcmw751.eamcs.ericsson.se (eusrcmw751.exu.ericsson.se [138.85.77.51]) by imr2.ericy.com (8.13.1/8.13.1) with ESMTP id n0LIqg5o015880 for ; Wed, 21 Jan 2009 12:52:42 -0600 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw751.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Wed, 21 Jan 2009 12:52:42 -0600 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Weird reverse problems Date: Wed, 21 Jan 2009 18:52:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA06CB132B@ecamlmw720.eamcs.ericsson.se> From: "Marc Khouzam" To: X-IsSubscribed: yes 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 X-SW-Source: 2009-01/txt/msg00146.txt.bz2 Hi, so I'm trying Reverse Debugging by having applied teawater's patches on top of HEAD which contains Michael S reverse infrastructure. I ran into some bizarre behavior when reverse stepping. I found that with (I'm guessing) library functions, a reverse next will skip a line. If you look at the simple session I ran below (a bit long, but very simple) you can see that on the reverse,=20 every two printf gets skipped. Also, on a reverse step, multiple sleep() can be skipped. Weird no? I tried to look at the code, but performing steps gets pretty low level, so I gave up. Thanks Marc GNU gdb (GDB) 6.8.50.20090113-cvs Copyright (C) 2009 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 "i686-pc-linux-gnu". For bug reporting instructions, please see: ... (gdb) l 1 #include 2 #include 3 4 int foo(int i) { 5 return i; 6 } 7 int main() 8 { 9 sleep(0);//1 10 sleep(0);//2 (gdb)=20 11 sleep(0);//3 12 sleep(0);//4 13 printf("A\n"); 14 printf("B\n"); 15 printf("C\n"); 16 printf("D\n"); 17 int a =3D 0; 18 a++; 19 printf("E\n"); 20 printf("F\n"); (gdb)=20 21 printf("G\n"); 22 printf("H\n"); 23 return a; 24 } (gdb) b main Breakpoint 1 at 0x80484bd: file a.cc, line 9. (gdb) r Starting program: /local/home/lmckhou/testing/a.out=20 Breakpoint 1, main () at a.cc:9 9 sleep(0);//1 (gdb) record (gdb) b 24 Breakpoint 2 at 0x804855b: file a.cc, line 24. (gdb) c Continuing. A B C D E F G H Breakpoint 2, main () at a.cc:24 24 } (gdb) rn 23 return a; (gdb) rn 21 printf("G\n"); <--- Missed a printf here! (gdb) rn 19 printf("E\n"); <--- Missed a printf here! (gdb) rn 18 a++; (gdb) rn 17 int a =3D 0; (gdb) rn 15 printf("C\n"); <--- Missed a printf here! (gdb) rn 13 printf("A\n"); <--- Missed a printf here! (gdb) rn 11 sleep(0);//3 <--- Missed a sleep here! (gdb) rn No more reverse-execution history. main () at a.cc:9 9 sleep(0);//1 (gdb) n 10 sleep(0);//2 (gdb) n 11 sleep(0);//3 (gdb) n 12 sleep(0);//4 (gdb) n 13 printf("A\n"); (gdb) rs 12 sleep(0);//4 (gdb) rs 11 sleep(0);//3 (gdb) rs 10 sleep(0);//2 (gdb) n 11 sleep(0);//3 (gdb) n 12 sleep(0);//4 (gdb) n 13 printf("A\n"); (gdb) n 14 printf("B\n"); (gdb) n 15 printf("C\n"); (gdb) rs 14 printf("B\n"); (gdb)=20 No more reverse-execution history. main () at a.cc:9 9 sleep(0);//1 <--- Woah, missed a bunch of stuff on the reverse step!