From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20187 invoked by alias); 3 Sep 2003 11:18:37 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20179 invoked from network); 3 Sep 2003 11:18:36 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 3 Sep 2003 11:18:36 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h83BIYl08597 for ; Wed, 3 Sep 2003 07:18:35 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h83BIXL28322 for ; Wed, 3 Sep 2003 07:18:33 -0400 Received: from cygbert.vinschen.de (vpn50-24.rdu.redhat.com [172.16.50.24]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h83BIWw12867 for ; Wed, 3 Sep 2003 04:18:32 -0700 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 700715804E; Wed, 3 Sep 2003 13:18:28 +0200 (CEST) Date: Wed, 03 Sep 2003 11:18:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: Re: [RFA] breakpoint.c, scanning epilogue if frame chain is invalid Message-ID: <20030903111828.GT1859@cygbert.vinschen.de> Reply-To: gdb-patches@sources.redhat.com Mail-Followup-To: gdb-patches@sources.redhat.com References: <20030903093815.GQ1859@cygbert.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-SW-Source: 2003-09/txt/msg00014.txt.bz2 On Wed, Sep 03, 2003 at 01:28:43PM +0200, Eli Zaretskii wrote: > > Date: Wed, 3 Sep 2003 11:38:15 +0200 > > From: Corinna Vinschen > > > > - if (within_current_scope && fr == get_current_frame () > > + if ((!within_current_scope || fr == get_current_frame ()) > > && gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ())) > > return WP_VALUE_NOT_CHANGED; > > if (within_current_scope) > > [...] > > The above patch is basically this: If we couldn't find the watchpoint > > frame, at least try to find out if PC is just in an epilogue. If so, > > it's probably the cause of failing to find the watchpoint frame so just > > leave the watchpoint alone until we're on firmer ground again. > > I'm not sure I understand why did you change > > within_current_scope && fr == get_current_frame () > > into > > (!within_current_scope || fr == get_current_frame ()) > > It doesn't seem to follow from the verbal description of the decision > you'd like the code to make. Perhaps I'm missing something, so could > you please elaborate how the verbal description translates into the > code? The lines before this code are fr = frame_find_by_id (b->watchpoint_frame); within_current_scope = (fr != NULL); So "within_current_scope" actually means "Couldn't find watchpoint frame". Being out of scope is one possible cause, being in an epilogue another. if (!within_current_scope || <== fr == NULL fr == get_current_frame ()) <== or fr != NULL and current frame == watchpoint frame then call gdbarch_in_function_epilogue_p(current pc). So after the change gdbarch_in_function_epilogue_p() is also called if the watchpoint frame couldn't be found because the frame chain is temporarily broken. Since this is very likely occuring in an epilogue, it's pretty naturally to call gdbarch_in_function_epilogue_p(). Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc.