* Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
@ 2010-12-17 3:20 Yuri
2010-12-27 5:07 ` Paul Pluzhnikov
2011-06-30 22:27 ` Yuri
0 siblings, 2 replies; 7+ messages in thread
From: Yuri @ 2010-12-17 3:20 UTC (permalink / raw)
To: gdb
All watchpoints are software.
How can I troubleshoot? How to understand why its unable to set HW
watchpoints?
Yuri
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
2010-12-17 3:20 Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)? Yuri
@ 2010-12-27 5:07 ` Paul Pluzhnikov
2011-06-30 22:31 ` Yuri
2011-06-30 22:27 ` Yuri
1 sibling, 1 reply; 7+ messages in thread
From: Paul Pluzhnikov @ 2010-12-27 5:07 UTC (permalink / raw)
To: Yuri; +Cc: gdb
On Thu, Dec 16, 2010 at 7:20 PM, Yuri <yuri@rawbw.com> wrote:
> All watchpoints are software.
> How can I troubleshoot? How to understand why its unable to set HW
> watchpoints?
You begin by explaining what made you conclude that you can't set HW
watchpoints, preferably by showing a sample program and a complete log
of your GDB session. Verifying that the same problem exists in current
CVS snapshot is also a good idea.
Hope this helps,
Happy Holidays!
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
2010-12-17 3:20 Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)? Yuri
2010-12-27 5:07 ` Paul Pluzhnikov
@ 2011-06-30 22:27 ` Yuri
1 sibling, 0 replies; 7+ messages in thread
From: Yuri @ 2011-06-30 22:27 UTC (permalink / raw)
To: gdb
On 12/16/2010 19:20, Yuri wrote:
> All watchpoints are software.
> How can I troubleshoot? How to understand why its unable to set HW
> watchpoints?
Now I see the same problem with 7.2 on FreeBSD amd64.
Since nobody seems to know here I filed this PR:
http://sourceware.org/bugzilla/show_bug.cgi?id=12953
Yuri
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
2010-12-27 5:07 ` Paul Pluzhnikov
@ 2011-06-30 22:31 ` Yuri
2011-06-30 22:50 ` Paul Pluzhnikov
0 siblings, 1 reply; 7+ messages in thread
From: Yuri @ 2011-06-30 22:31 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb
On 12/26/2010 21:06, Paul Pluzhnikov wrote:
> On Thu, Dec 16, 2010 at 7:20 PM, Yuri<yuri@rawbw.com> wrote:
>
>> All watchpoints are software.
>> How can I troubleshoot? How to understand why its unable to set HW
>> watchpoints?
>>
> You begin by explaining what made you conclude that you can't set HW
> watchpoints, preferably by showing a sample program and a complete log
> of your GDB session. Verifying that the same problem exists in current
> CVS snapshot is also a good idea.
>
Sorry, I missed your reply.
This happens on all programs.
I "conclude" by seeing that it prints "Watchpoint" not "Hardware
watchpoint" and observing a very slow execution after it is set.
(gdb) watch *(char*)0x3c74340
Watchpoint 6: *(char*)0x3c74340
(gdb) c
<...very long wait...>
Yuri
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
2011-06-30 22:31 ` Yuri
@ 2011-06-30 22:50 ` Paul Pluzhnikov
2011-06-30 23:40 ` Yuri
0 siblings, 1 reply; 7+ messages in thread
From: Paul Pluzhnikov @ 2011-06-30 22:50 UTC (permalink / raw)
To: Yuri; +Cc: gdb
On Thu, Jun 30, 2011 at 3:31 PM, Yuri <yuri@rawbw.com> wrote:
> On 12/26/2010 21:06, Paul Pluzhnikov wrote:
>>
>> You begin by explaining what made you conclude that you can't set HW
>> watchpoints, preferably by showing a sample program and a complete log
>> of your GDB session. Verifying that the same problem exists in current
>> CVS snapshot is also a good idea.
You didn't show *complete* log of your GDB session.
This leaves us to guess which version of GDB you are using (your message
says 7.2), and what platform it was configured for.
Verifying that the problem exists in latest CVS snapshot is *still*
a good idea.
> This happens on all programs.
> I "conclude" by seeing that it prints "Watchpoint" not "Hardware watchpoint"
> and observing a very slow execution after it is set.
>
> (gdb) watch *(char*)0x3c74340
> Watchpoint 6: *(char*)0x3c74340
> (gdb) c
> <...very long wait...>
Is 0x3c74340 addressable at the point where you set the watch?
(This also likely would have been answered by a complete log of your
GDB session.)
Cheers,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
2011-06-30 22:50 ` Paul Pluzhnikov
@ 2011-06-30 23:40 ` Yuri
2011-07-01 10:02 ` Pedro Alves
0 siblings, 1 reply; 7+ messages in thread
From: Yuri @ 2011-06-30 23:40 UTC (permalink / raw)
To: gdb
Please find below the log of the whole session with gdb_7_3-branch (BTW
it still prints the 7.2 version number).
I used this C++ program:
#include <string.h>
void ms(char *p) {
memset(p, 0, 1024);
}
main() {
char buf1[1024];
buf1[256] = 7;
ms(buf1);
}
Please also note that with watchpoint active it was taking a long time
for gdb to restart the program after 'Starting program' line.
Yuri
---- gdb session log ----
[yuri@mybsd ~/gdb]$ gdb ./main
GNU gdb (GDB) 7.2.90.20110630-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
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 "x86_64-unknown-freebsd8.2".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/home/yuri/gdb/main...done.
(gdb) b main
Breakpoint 1 at 0x40065b: file main.C, line 9.
(gdb) r
Starting program: /usr/home/yuri/gdb/main
Breakpoint 1, main () at main.C:9
9 buf1[256] = 7;
(gdb) n
10 ms(buf1);
(gdb) p &buf1[256]
$1 = 0x7fffffffddd0 "\a"
(gdb) watch *(char*)0x7fffffffddd0
Watchpoint 2: *(char*)0x7fffffffddd0
(gdb) c
Continuing.
Watchpoint 2: *(char*)0x7fffffffddd0
Old value = 7 '\a'
New value = 0 '\000'
0x0000000800b78074 in memset () from /lib/libc.so.7
(gdb) c
Continuing.
Watchpoint 2: *(char*)0x7fffffffddd0
Old value = 0 '\000'
New value = 1 '\001'
0x0000000800505c6c in ?? () from /libexec/ld-elf.so.1
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/home/yuri/gdb/main
^C
Program received signal SIGINT, Interrupt.
0x0000000800505959 in ?? () from /libexec/ld-elf.so.1
(gdb) quit
A debugging session is active.
Inferior 1 [process 49302] will be killed.
Quit anyway? (y or n) y
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)?
2011-06-30 23:40 ` Yuri
@ 2011-07-01 10:02 ` Pedro Alves
0 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2011-07-01 10:02 UTC (permalink / raw)
To: gdb; +Cc: Yuri
On Friday 01 July 2011 00:40:07, Yuri wrote:
> This GDB was configured as "x86_64-unknown-freebsd8.2".
It doesn't looks like the x86-64/FreeBSD port knows about
hardware watchpoints. The 32-bit port seems to though:
$ grep i386_use_watchpoints *.c
amd64-linux-nat.c: i386_use_watchpoints (t);
go32-nat.c: i386_use_watchpoints (&go32_ops);
i386fbsd-nat.c: i386_use_watchpoints (t);
i386-linux-nat.c: i386_use_watchpoints (t);
i386-nat.c:i386_use_watchpoints (struct target_ops *t)
windows-nat.c: i386_use_watchpoints (&windows_ops);
The x86-64/FreeBSD target backend file is amd64fbsd-nat.c.
Try debugging gdb with itself, and put a breakpoint on
i386_use_watchpoints. If that isn't hit on gdb startup, then
the port definitely doesn't know about hardware watchpoints.
--
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-07-01 10:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-17 3:20 Why gdb-7.1 doesn't set hardware watchpoints on i7 CPU (amd64)? Yuri
2010-12-27 5:07 ` Paul Pluzhnikov
2011-06-30 22:31 ` Yuri
2011-06-30 22:50 ` Paul Pluzhnikov
2011-06-30 23:40 ` Yuri
2011-07-01 10:02 ` Pedro Alves
2011-06-30 22:27 ` Yuri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox