From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31042 invoked by alias); 3 Mar 2009 20:33:19 -0000 Received: (qmail 31033 invoked by uid 22791); 3 Mar 2009 20:33:18 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Mar 2009 20:33:14 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id BAA97107D3; Tue, 3 Mar 2009 20:33:12 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 9D1AF10781; Tue, 3 Mar 2009 20:33:10 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LebIb-0000lh-UO; Tue, 03 Mar 2009 15:33:09 -0500 Date: Tue, 03 Mar 2009 20:33:00 -0000 From: Daniel Jacobowitz To: Antony KING Cc: gdb@sourceware.org Subject: Re: [GDB 6.8] Problem using watchpoints with compound objects Message-ID: <20090303203309.GA2672@caradoc.them.org> Mail-Followup-To: Antony KING , gdb@sourceware.org References: <49AD6B30.2010102@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49AD6B30.2010102@st.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes 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: 2009-03/txt/msg00027.txt.bz2 On Tue, Mar 03, 2009 at 05:38:56PM +0000, Antony KING wrote: > After applying the patch for problem 1 I then encountered a second > problem where a watchpoint is being erroneously dismissed as being > unchanged. I believe this problem is due to the following test in > watchpoint_check(): > > if (!value_equal (b->val, new_val)) > > This test is only comparing the address of the object and not its > contents. I think the test should be revised to the following: What are you setting a watchpoint on? value_equal is an implementation of the equality operator in the CLI. If you have a pointer, it will only compare the addresses, but for a struct object it should compare contents. -- Daniel Jacobowitz CodeSourcery