From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19968 invoked by alias); 10 Nov 2009 07:39:55 -0000 Received: (qmail 19960 invoked by uid 22791); 10 Nov 2009 07:39:54 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pw0-f49.google.com (HELO mail-pw0-f49.google.com) (209.85.160.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Nov 2009 07:39:49 +0000 Received: by pwj21 with SMTP id 21so2350629pwj.8 for ; Mon, 09 Nov 2009 23:39:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.8.12 with SMTP id 12mr962666wfh.70.1257838788158; Mon, 09 Nov 2009 23:39:48 -0800 (PST) In-Reply-To: <4AF88765.2020206@vmware.com> References: <4AECE12F.3000704@vmware.com> <4AF31C1F.2000405@vmware.com> <4AF88765.2020206@vmware.com> From: Hui Zhu Date: Tue, 10 Nov 2009 07:39:00 -0000 Message-ID: Subject: Re: [RFA] Fix hw watchpoints in process record. To: Michael Snyder Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2009-11/txt/msg00202.txt.bz2 My os is ubuntu 8.0.4 i386 gcc version 4.2.4. The following is a simple hw in my pc: Temporary breakpoint 1, main () at 1.c:20 20 int b =3D 0; (gdb) hb 31 During symbol reading, incomplete CFI data; unspecified registers (e.g., eax) at 0x80483be. Hardware assisted breakpoint 2 at 0x8048447: file 1.c, line 31. (gdb) set debug infrun 1 (gdb) c Continuing. infrun: clear_proceed_status_thread (process 20269) infrun: proceed (addr=3D0xffffffff, signal=3D144, step=3D0) infrun: resume (step=3D0, signal=3D0), trap_expected=3D0 infrun: wait_for_inferior (treat_exec_as_sigtrap=3D0) a =3D 0 b =3D 0 c =3D 1 a =3D 3 a =3D 3 b =3D 3 c =3D 1 a =3D 3 b =3D 3 c =3D 2 infrun: target_wait (-1, status) =3D infrun: 20269 [process 20269], infrun: status->kind =3D stopped, signal =3D SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc =3D 0x8048447 infrun: BPSTAT_WHAT_STOP_NOISY infrun: stop_stepping Breakpoint 2, main () at 1.c:31 31 a -=3D 2; The following is the hw with prec: Temporary breakpoint 1, main () at 1.c:20 20 int b =3D 0; (gdb) record (gdb) set debug infrun 1 (gdb) hb 31 During symbol reading, incomplete CFI data; unspecified registers (e.g., eax) at 0x80483be. Hardware assisted breakpoint 2 at 0x8048447: file 1.c, line 31. (gdb) c Continuing. infrun: clear_proceed_status_thread (process 1842) infrun: proceed (addr=3D0xffffffff, signal=3D144, step=3D0) infrun: resume (step=3D0, signal=3D0), trap_expected=3D0 infrun: wait_for_inferior (treat_exec_as_sigtrap=3D0) a =3D 0 b =3D 0 c =3D 1 a =3D 3 a =3D 3 b =3D 3 c =3D 1 a =3D 3 b =3D 3 c =3D 2 infrun: target_wait (-1, status) =3D infrun: 1842 [process 1842], infrun: status->kind =3D stopped, signal =3D SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc =3D 0x8048448 infrun: random signal 5 Program received signal SIGTRAP, Trace/breakpoint trap. infrun: stop_stepping 0x08048448 in main () at 1.c:31 31 a -=3D 2; Looks like the stop_pc is not right. Thanks, Hui On Tue, Nov 10, 2009 at 05:19, Michael Snyder wrote: > Hui Zhu wrote: >> >> Still not very well, with the old program: >> >> (gdb) start >> Temporary breakpoint 1 at 0x80483c1: file 1.c, line 20. >> Starting program: /home/teawater/gdb/a.out >> warning: the debug information found in "/lib/ld-2.7.so" does not >> match "/lib/ld-linux.so.2" (CRC mismatch). >> >> warning: the debug information found in >> "/lib/tls/i686/cmov/libc-2.7.so" does not match >> "/lib/tls/i686/cmov/libc.so.6" (CRC mismatch). >> >> >> Temporary breakpoint 1, main () at 1.c:20 >> 20 =A0 =A0 =A0 =A0 =A0 =A0 int =A0 =A0 b =3D 0; >> (gdb) record >> (gdb) n >> During symbol reading, incomplete CFI data; unspecified registers >> (e.g., eax) at 0x80483be. >> 21 =A0 =A0 =A0 =A0 =A0 =A0 int =A0 =A0 c =3D 1; >> (gdb) >> 24 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf ("a =3D %d b =3D %d c =3D %d\n", a,= b, c); >> (gdb) hw >> Undefined command: "hw". =A0Try "help". >> (gdb) hb >> Hardware assisted breakpoint 2 at 0x80483cf: file 1.c, line 24. >> (gdb) c >> Continuing. >> a =3D 0 b =3D 0 c =3D 1 >> a =3D 3 >> a =3D 3 b =3D 3 c =3D 1 >> a =3D 3 b =3D 3 c =3D 2 >> a =3D 1 b =3D 3 c =3D 2 >> The next instruction is syscall exit_group. =A0It will make the program >> exit. =A0Do you want to stop the program?([y] or n) >> Process record: inferior program stopped. >> >> Program received signal SIGTRAP, Trace/breakpoint trap. >> 0xb7fe3405 in __kernel_vsyscall () >> (gdb) rc >> Continuing. >> >> Breakpoint 2, main () at 1.c:24 >> 24 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf ("a =3D %d b =3D %d c =3D %d\n", a,= b, c); >> (gdb) rc >> Continuing. >> >> No more reverse-execution history. >> main () at 1.c:20 >> 20 =A0 =A0 =A0 =A0 =A0 =A0 int =A0 =A0 b =3D 0; >> (gdb) c >> Continuing. >> >> Program received signal SIGTRAP, Trace/breakpoint trap. >> 0x080483d0 in main () at 1.c:24 >> 24 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf ("a =3D %d b =3D %d c =3D %d\n", a,= b, c); >> (gdb) c >> Continuing. >> >> No more reverse-execution history. >> 0xb7fe3405 in __kernel_vsyscall () >> (gdb) rc >> Continuing. >> >> No more reverse-execution history. >> main () at 1.c:20 >> 20 =A0 =A0 =A0 =A0 =A0 =A0 int =A0 =A0 b =3D 0; >> (gdb) c >> Continuing. >> >> No more reverse-execution history. >> 0xb7fe3405 in __kernel_vsyscall () >> (gdb) rc >> Continuing. >> >> No more reverse-execution history. >> main () at 1.c:20 >> 20 =A0 =A0 =A0 =A0 =A0 =A0 int =A0 =A0 b =3D 0; >> (gdb) info b >> Num =A0 =A0 Type =A0 =A0 =A0 =A0 =A0 Disp Enb Address =A0 =A0What >> 2 =A0 =A0 =A0 hw breakpoint =A0keep y =A0 0x080483cf in main at 1.c:24 >> =A0 =A0 =A0 =A0breakpoint already hit 1 time >> (gdb) c >> Continuing. >> >> No more reverse-execution history. >> 0xb7fe3405 in __kernel_vsyscall () >> >> >> Thanks, >> Hui > > That's odd, I don't get anything like that. > It basically works correctly for me, except for > an unrelated bug that I'm currently looking into. > > I'm using RHEL4 and gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-11) > > >