From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14097 invoked by alias); 21 Oct 2006 15:29:13 -0000 Received: (qmail 14088 invoked by uid 22791); 21 Oct 2006 15:29:12 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 21 Oct 2006 15:29:09 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-20-165.inter.net.il [80.230.20.165]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id GBB39063 (AUTH halo1); Sat, 21 Oct 2006 17:29:05 +0200 (IST) Date: Sat, 21 Oct 2006 15:29:00 -0000 Message-Id: From: Eli Zaretskii To: "Rodney M. Bates" CC: gdb@sourceware.org In-reply-to: <453A3758.5090602@wichita.edu> (rodney.bates@wichita.edu) Subject: Re: breakpoint for accessing memory location Reply-to: Eli Zaretskii References: <4537DBC6.1030807@hccnet.nl> <20061019201214.GA32332@nevyn.them.org> <4537DEDC.5000008@hccnet.nl> <453A3758.5090602@wichita.edu> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00176.txt.bz2 > Date: Sat, 21 Oct 2006 10:06:00 -0500 > From: "Rodney M. Bates" > CC: gdb@sourceware.org > > But while this subject is open, I would like to see more explanation on just > what the semantics of evaluating a watchpoint expression are. An expression > always is evaluated in a particular context that can affect the legality/result, > but in the case of a watchpoint, execution is proceeding and changing the > context. I have never been sure what the rules are. > For example, I sometimes want to watch p->f, where p is local variable that > I know perfectly well will soon cease to exist, but I also know *p will > remain. I've long since learned that watching p->f doesn't work. Instead, > I print the address of p->f and then watch the contents of that address. Does "watch *(f> *)&p->f" work as well? > But more information on the general rules would be helpful in the manual. Are there any more examples beyond p->f? That is, what other situations are there where the context can matter? Are we talking only about portions of expression going out of context (and thus becoming invalid), or are there other problems? (You see, I don't think I understand what you mean by ``the semantics of evaluating a watchpoint expression'', and a single example you gave is not enough for me to figure that out.)