This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix hw watchpoints in process record.


On Thu, Nov 5, 2009 at 01:51, Michael Snyder <msnyder@vmware.com> wrote:
> Hui Zhu wrote:
>>
>> Hi Michael,
>>
>> I do some test with this patch. ?But sometime hb didn't work in replay
>> mode.
>> For example:
>> Temporary breakpoint 1, main () at 1.c:20
>> 20 ? ? ? ? ? ? int ? ? b = 0;
>> (gdb) record
>> (gdb) n
>> During symbol reading, incomplete CFI data; unspecified registers
>> (e.g., eax) at 0x80483be.
>> 21 ? ? ? ? ? ? int ? ? c = 1;
>> (gdb) hb
>> Hardware assisted breakpoint 2 at 0x80483c8: file 1.c, line 21.
>> (gdb) c
>> Continuing.
>> a = 0 b = 0 c = 1
>> a = 3
>> a = 3 b = 3 c = 1
>> a = 3 b = 3 c = 2
>> a = 1 b = 3 c = 2
>> The next instruction is syscall exit_group. ?It will make the program
>> exit. ?Do 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:21
>> 21 ? ? ? ? ? ? int ? ? c = 1;
>> (gdb) info b
>> Num ? ? Type ? ? ? ? ? Disp Enb Address ? ?What
>> 2 ? ? ? hw breakpoint ?keep y ? 0x080483c8 in main at 1.c:21
>> ? ? ? ?breakpoint already hit 1 time
>> (gdb) c
>> Continuing.
>>
>> No more reverse-execution history.
>> 0xb7fe3405 in __kernel_vsyscall ()
>> (gdb) rc
>> Continuing.
>>
>> Breakpoint 2, main () at 1.c:21
>> 21 ? ? ? ? ? ? int ? ? c = 1;
>>
>>
>> Thanks,
>> Hui
>>
>
>
> Source code for your test case?
>
>
int     a = 0;
void
cool2 ()
{
	printf ("a = %d\n", a);
}
int
cool ()
{
       a += 3;


cool2();

       return (a);
}
int
main()
{
       int     b = 0;
       int     c = 1;


	printf ("a = %d b = %d c = %d\n", a, b, c);
       b = cool ();
	printf ("a = %d b = %d c = %d\n", a, b, c);


       c += 1;
	printf ("a = %d b = %d c = %d\n", a, b, c);
       a -= 2;
	printf ("a = %d b = %d c = %d\n", a, b, c);


return (0);
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]