From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16960 invoked by alias); 3 Mar 2009 21:46:18 -0000 Received: (qmail 16794 invoked by uid 22791); 3 Mar 2009 21:46:17 -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 21:46:09 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 72E01107D3; Tue, 3 Mar 2009 21:46:07 +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 5B4DF10781; Tue, 3 Mar 2009 21:46:07 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LecRC-0002Wa-5R; Tue, 03 Mar 2009 16:46:06 -0500 Date: Tue, 03 Mar 2009 21:46: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: <20090303214606.GA9404@caradoc.them.org> Mail-Followup-To: Antony KING , gdb@sourceware.org References: <49AD6B30.2010102@st.com> <20090303203309.GA2672@caradoc.them.org> <49AD9E8A.3020608@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49AD9E8A.3020608@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/msg00030.txt.bz2 On Tue, Mar 03, 2009 at 09:18:02PM +0000, Antony KING wrote: > struct {int m1, m2, m3, m4;} a; > int main (void) > { > a.m1 = 1; > return 0; > } > > In both cases value_equal is comparing the address of the object and not > the contents. This is caused, I believe, by the following code at the > start of value_equal: > > arg1 = coerce_array (arg1); > arg2 = coerce_array (arg2); > > which is converting the compound objects into pointers. These are then > used in the latter tests of value_equal. Arrays are supposed to be handled specially, but I was talking about structs since that was in your original example. coerce_array has no effect on structs. -- Daniel Jacobowitz CodeSourcery