From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14473 invoked by alias); 22 Jan 2012 02:45:28 -0000 Received: (qmail 14461 invoked by uid 22791); 22 Jan 2012 02:45:27 -0000 X-SWARE-Spam-Status: No, hits=1.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SARE_SPEC_REPL_OBFU1 X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jan 2012 02:45:14 +0000 Received: by iadj38 with SMTP id j38so3638574iad.0 for ; Sat, 21 Jan 2012 18:45:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.15.230 with SMTP id a6mr4875677igd.24.1327200314132; Sat, 21 Jan 2012 18:45:14 -0800 (PST) Received: by 10.231.33.72 with HTTP; Sat, 21 Jan 2012 18:45:14 -0800 (PST) Date: Sun, 22 Jan 2012 02:45:00 -0000 Message-ID: Subject: watch -location From: Jed Brown To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00064.txt.bz2 I was surprised when I upgraded to 7.3.1 that my common pattern of (gdb) print &obj->member $1 =3D (int *) 0x6fcf04 (gdb) watch *$1 was no longer watching the value at this address. I found that the changelog mentioned the new -location option, which makes this much nicer (gdb) watch -location obj->member Hardware watchpoint 3: -location obj->member I like the new method, but why did the old method stop working? It makes some old debugging documentation incorrect. I currently see (gdb) info watchpoints Num =C2=A0 =C2=A0 Type =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Disp Enb Address = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0What 3 =C2=A0 =C2=A0 =C2=A0 hw watchpoint =C2=A0keep y =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-location obj->member Could the address of obj->member be printed in this output? It would be useful for me to distinguish multiple watchpoints set for members of different objects. (I.e. I set watchpoints twice from the same scope with the same commands, but with different values of "obj", and I'd like to be able to distinguish which of these are related other than to remember which numbers refer to members of which object.)