Hello, I wrote:
>>I rolled up several patches along with my changes to fix HW breakpoints
>>on x86_64 and i386. I also deprecated some of the #defines in favor of
>>using the kgdb_ops to control the HW breakpoints for other non IA archs
>>at the point that these are implemented.
>>Until such time that there is a common interface for kernel HW
>>breakpoints, if a user space application uses HW breakpoints the kernel
>>breakpoints will disappear. I tested execution, data access and data
>>write breakpoints and all work with gdb 6.6.
>>If there are no objections, I am going to replace the i386.patch with
>>i386_hw_breakpoints.patch and x86_64_breakpoints.patch and merge the
>>core changes for arch breakpoints to core-lite.patch.
> Unfortunately, h/w watchpoints don't seem to work on x86_64. That's what
> I'm getting with 2.6.21.5-rt10 and gdb 6.5.50:
> (gdb) watch jiffies
> Hardware watchpoint 2: jiffies
> (gdb) c
> Continuing.
> warning: Could not remove hardware watchpoint 2.
> Warning:
> Could not insert hardware watchpoint 2.
> Could not insert hardware breakpoints:
> You may have requested too many hardware breakpoints/watchpoints.
Ugh... that's actually due to gdb considering jiffies 64-bit variable;
here's the debugging log:
breakpoint () at kernel/kgdb.c:1773
1773 }
Sending packet: $qSymbol::#5b...Ack
Packet received:
Packet qSymbol (symbol-lookup) is NOT supported
(gdb) watch jiffies
Sending packet: $mffffffff808b4300,8#ca...Ack
Packet received: bfe4feff00000000
Hardware watchpoint 1: jiffies
(gdb) c
Continuing.
Sending packet: $Z0,ffffffff80259b41,1#12...Ack
Packet received: OK
Packet Z0 (software-breakpoint) is supported
Sending packet: $mffffffff808b4300,8#ca...Ack
Packet received: bfe4feff00000000
Sending packet: $Z2,ffffffff808b4300,8#15...Ack
Packet received: E01
Packet Z2 (write-watchpoint) is supported
Sending packet: $z2,ffffffff808b4300,8#35...Ack
Packet received: E01
warning: Could not remove hardware watchpoint 1.
Warning:
Could not insert hardware watchpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
(gdb) watch *(unsigned *)&jiffies
Sending packet: $mffffffff808b4300,4#c6...Ack
Packet received: bfe4feff
Hardware watchpoint 2: *(unsigned int *) &jiffies
(gdb) c
Continuing.
Sending packet: $mffffffff808b4300,4#c6...Ack
Packet received: bfe4feff
Sending packet: $Z2,ffffffff808b4300,4#11...Ack
Packet received: OK
Well, forcing 32-bit type on juffies works!
Sending packet: $vCont?#49...Ack
Packet received:
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $c#63...Ack
Packet received: T05thread:0000000000008000;
[New Thread 32768]
Sending packet: $g#67...Ack
Packet received:
00b2144003000000d4ae370000000000003ae5ee0000000060508780ffffffff00782f5102000000eb03000000000000d81e9180ffffffffc81e9180ffffffff0000000000000000010000000000000001000000000000000100000000000000687e8b80ffffffff405c84050081ffffd4604c4003000000eb03000000000000a2362380ffffffff1600000000000000
Sending packet: $mffffffff808b4300,8#ca...Ack
Packet received: aae8feff00000000
Sending packet: $mffffffff808b4300,4#c6...Ack
Packet received: aae8feff
[Switching to Thread 32768]
Sending packet: $z0,ffffffff80259b41,1#32...Ack
Packet received: OK
Sending packet: $z2,ffffffff808b4300,8#35...Ack
Packet received: OK
Sending packet: $z2,ffffffff808b4300,4#31...Ack
Packet received: E01
warning: Could not remove hardware watchpoint 2.
Hardware watchpoint 1: jiffies
Old value = 0xfffee4bf
New value = 0xfffee8aa
Hardware watchpoint 2: *(unsigned int *) &jiffies
Old value = 0xfffee4bf
New value = 0xfffee8aa
do_timer (ticks=0x3eb) at include/linux/clocksource.h:158
158 return cs->read();
(gdb) inf b
Num Type Disp Enb Address What
1 hw watchpoint keep y jiffies
breakpoint already hit 1 time
2 hw watchpoint keep y *(unsigned int *) &jiffies
breakpoint already hit 1 time
Now we have 2 watchpoints with the same address. Delete the wrong one:
(gdb) del 1
(gdb) c
Continuing.
Sending packet: $Z0,ffffffff80259b41,1#12...Ack
Packet received: OK
Sending packet: $c#63...Ack
remote_interrupt called
remote_stop called
Packet received: T05thread:0000000000000205;
[New Thread 517]
Sending packet: $g#67...Ack
Packet received:
cc00000000000000fa030100000000000000000000000000c057a87e0081ffffc0cc9880fffffffffa03010000000000401eaf7e0081ffff401eaf7e0081ffff4054bc050081ffff0100000000000000000000000000000001000000000000000000000000000000d0798880ffffffff00000000000000000400000000000000579c2580ffffffff4602000000000000
Sending packet: $mffffffff808b4300,4#c6...Ack
Packet received: 44fcfeff
[Switching to Thread 517]
Sending packet: $z0,ffffffff80259b41,1#32...Ack
Packet received: OK
Sending packet: $z2,ffffffff808b4300,4#31...Ack
Packet received: E01
warning: Could not remove hardware watchpoint 2.
Hardware watchpoint 2: *(unsigned int *) &jiffies
And it looks like we've lost the valid one. It never occurs, so I have to
press ctrl-C:
Old value = 0xfffee8aa
New value = 0xfffefc44
breakpoint () at kernel/kgdb.c:1773
1773 }
(gdb) bt
WBR, Sergei
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport