From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22421 invoked by alias); 20 Apr 2006 19:12:35 -0000 Received: (qmail 22413 invoked by uid 22791); 20 Apr 2006 19:12:34 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 20 Apr 2006 19:12:33 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FWeZr-0005lg-2A for gdb@sourceware.org; Thu, 20 Apr 2006 15:12:31 -0400 Date: Sat, 22 Apr 2006 08:06:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Subject: Re: Checking if addess is on stack? Message-ID: <20060420191231.GA22029@nevyn.them.org> Mail-Followup-To: gdb@sourceware.org References: <200604201426.59360.ghost@cs.msu.su> <200604201548.36899.ghost@cs.msu.su> <20060420124903.GA11015@nevyn.them.org> <20060420143944.GA14255@nevyn.them.org> <20060420184153.GA21153@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i 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-04/txt/msg00285.txt.bz2 On Thu, Apr 20, 2006 at 10:03:11PM +0300, Eli Zaretskii wrote: > That's one possible situation, sure. But there are others: someone > could be scribbling over ptr->i by inadvertently changing ptr itself. > > If you think this latter situation is unlikely or uninteresting, you > in effect say that our whole concept of watching expression values is > wrong. It depends what you're debugging, of course. I'm generally debugging "something in the list is wrong, later, in another function"; "something in this function clobbered the loop pointer" is much rarer. That's likely to be in a register, for instance. I think that the idea of watching expression values is useful as an option, but if there's more than one memory location involved I can't think when the last time I wanted the current behavior was. And I find it very unintuitive that "print &foo->bar; watch *$31" is not the same as "watch foo->bar" (and that the former is so cumbersome). But I'm not suggesting changing our behavior at this late date. > In your example, you (the user) knew what you were after. I was > arguing that doing this always in a front end, like what Vladimir was > suggesting, might not be what users expect in each particular case. I would believe that it is more often correct, especially if the GUI is used to set the watchpoint - if I clicked on a member of a structure and said "watch this", I'd mean the member, not whatever expression I followed to get that window to pop up. -- Daniel Jacobowitz CodeSourcery