public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/10136] New: rwatch not working when set before run
@ 2009-05-09 18:55 niko dot sams at gmail dot com
  2009-11-17 22:44 ` [Bug breakpoints/10136] " pedro at codesourcery dot com
  0 siblings, 1 reply; 2+ messages in thread
From: niko dot sams at gmail dot com @ 2009-05-09 18:55 UTC (permalink / raw)
  To: gdb-prs

When setting a read watchpoint for a static variable I get the error "Target 
does not support this type of hardware watchpoint." Same problem with awatch. 
watch works correctly.
$ gdb debugee
GNU gdb (GDB) 6.8.50.20090509-cvs
(gdb) l 25
20      void noop() {}
21      void foo() {
22          static int i=0;
23          ++i;
24          noop();
25          noop();
26      }
27      int main(int argc, char **argv) {
28          std::cout << "Hello, world!" << std::endl;
29          foo();
(gdb) rwatch foo::i
Target does not support this type of hardware watchpoint.

Setting the watchpoint after a breakpoint was it works:
$ gdb debugee
GNU gdb (GDB) 6.8.50.20090509-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
(gdb) break main
Breakpoint 1 at 0x400a70: 
file /home/niko/kdesvn/kde-git/kdevelop/debuggers/gdb/unittests/debugee.cpp, 
line 28.
(gdb) r
Starting 
program: /home/niko/kdesvn/build/kde-git/kdevelop/debuggers/gdb/unittests/debugee

Breakpoint 1, main (argc=1, argv=0x7fffffffdbc8) 
at /home/niko/kdesvn/kde-git/kdevelop/debuggers/gdb/unittests/debugee.cpp:28
28          std::cout << "Hello, world!" << std::endl;
(gdb) rwatch foo::i
Hardware read watchpoint 2: foo::i
(gdb)                                                                                     


Gdb 6.8 works:
$ /usr/bin/gdb debugee
GNU gdb 6.8
(gdb) rwatch foo::i
Hardware read watchpoint 1: foo()::i
(gdb)

-- 
           Summary: rwatch not working when set before run
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: niko dot sams at gmail dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10136

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug breakpoints/10136] rwatch not working when set before run
  2009-05-09 18:55 [Bug breakpoints/10136] New: rwatch not working when set before run niko dot sams at gmail dot com
@ 2009-11-17 22:44 ` pedro at codesourcery dot com
  0 siblings, 0 replies; 2+ messages in thread
From: pedro at codesourcery dot com @ 2009-11-17 22:44 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2009-11-17 22:44 -------
This is a consequence of moving watchpoint ops to the target vector, and
to the fact that the native target is only pushed when the inferior is created.

The workaround is running to main before setting the read or access
watchpoints.  E.g. with, '(gdb) start'.

Plain "watch" works, because gdb creates a "software watchpoint" then,
and upgrades it to a hardware watchpoint later, when the process is
actually created (and the native target is pushed on the target stack).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=10136

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-17 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-09 18:55 [Bug breakpoints/10136] New: rwatch not working when set before run niko dot sams at gmail dot com
2009-11-17 22:44 ` [Bug breakpoints/10136] " pedro at codesourcery dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).