This is the mail archive of the gdb-prs@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]

[Bug breakpoints/9681] New: gdb-weekly-6.8.50.20081216 lets you set watchpoints on nonexistent struct members


Seen with gdb-weekly-6.8.50.20081216.tar.bz2 on Linux/ix86 native.

This snapshot of gdb will happily allow you to put watchpoints on structure
members which don't exist:
  (gdb) watch myfoo.nosuchmember
  Watchpoint 2: myfoo.nosuchmember

Trying the same thing with ubuntu's gdb (which advertises itself as "GNU gdb
6.8-debian") gives:
  (gdb) watch myfoo.nosuchmember
  There is no member named nosuchmember.

So I guess this is a regression. It seems to be watchpoint-specific; for
instance "print myfoo.nosuch" correctly gives an error.

The transcript below gives a more complete test example.

pm215@canth:~/gdb-srcs$ cat t.c
struct foo {
  int x;
  int y;
};
struct foo myfoo;
int main(void) {
  myfoo.x = 1;
  return 0;
}
pm215@canth:~/gdb-srcs$ gcc -g -Wall -o t t.c
pm215@canth:~/gdb-srcs$ build/gdb/gdb t
GNU gdb (GDB) 6.8.50.20081216
Copyright (C) 2008 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 "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) break main
Breakpoint 1 at 0x80483a2: file t.c, line 7.
(gdb) run
Starting program: /home/pm215/gdb-srcs/t

Breakpoint 1, main () at t.c:7
7         myfoo.x = 1;
(gdb) watch myfoo.nosuchmember
Watchpoint 2: myfoo.nosuchmember
(gdb) c
Continuing.

Program exited normally.
Current language:  auto; currently asm

-- 
           Summary: gdb-weekly-6.8.50.20081216 lets you set watchpoints on
                    nonexistent struct members
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: pmaydell at chiark dot greenend dot org dot uk
                CC: gdb-prs at sourceware dot org
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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

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


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