From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14940 invoked by alias); 20 Apr 2006 10:27:24 -0000 Received: (qmail 14931 invoked by uid 22791); 20 Apr 2006 10:27:24 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Apr 2006 10:27:21 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1FWWNU-0005w8-OX for gdb@sources.redhat.com; Thu, 20 Apr 2006 14:27:18 +0400 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1FWWNI-0005tR-Iv; Thu, 20 Apr 2006 14:27:00 +0400 From: Vladimir Prus To: Eli Zaretskii Subject: Re: Checking if addess is on stack? Date: Thu, 20 Apr 2006 11:48:00 -0000 User-Agent: KMail/1.7.2 Cc: gdb@sources.redhat.com References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604201426.59360.ghost@cs.msu.su> 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/msg00268.txt.bz2 On Thursday 20 April 2006 14:22, Eli Zaretskii wrote: > > From: Vladimir Prus > > Date: Thu, 20 Apr 2006 12:49:53 +0400 > > > > in order to improve watchpoints handling in KDevelop, I need to figure > > out if a given address is part of current frame's stack. Is there any > > command to produce that information? I guess I can look at frame base > > address and check if my address is "close" to that, but it's a bit > > unreliable. > > > > For reference, the watchpoint changes for KDevelop are outlined at: > > > > http://lists.kde.org/?l=kdevelop-devel&m=114552206721831&w=2 > > I think one way to solve the problems you describe in that URL is to > set a temporary breakpoint whose commands set the watchpoint: > > tb do_that > commands > > > watch ptr->i > > continue > > end > > (and similarly for block-local variables: put a breakpoint on the > block's first line). If you want to keep the watchpoints between > sessions, record the temporary breakpoints and reinsert them when the > session starts. > > Would this do what you want? I'm not sure that's exactly what I need. This way, watchpoint will be automatically inserted when I enter 'do_that', but as soon as I leave 'do_that', gdb will remove wathchpoint because 'ptr' has gone out of scope. This will prevent me from catching accesses to ptr->i made outside of the function where 'ptr' is valid. Am I missing something? Thanks, Volodya