From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1005 invoked by alias); 2 Sep 2009 16:24:21 -0000 Received: (qmail 987 invoked by uid 22791); 2 Sep 2009 16:24:20 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Sep 2009 16:24:12 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A02EA2BAB63 for ; Wed, 2 Sep 2009 12:24:10 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4KrUNNV9qT6T for ; Wed, 2 Sep 2009 12:24:10 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 670AD2BAB4C for ; Wed, 2 Sep 2009 12:24:10 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6E537F589A; Wed, 2 Sep 2009 09:24:02 -0700 (PDT) Date: Wed, 02 Sep 2009 16:24:00 -0000 From: Joel Brobecker To: gdb@sourceware.org Subject: Re: More info on PR/9711 (quadratic slowdown for deep stack traces) Message-ID: <20090902162402.GQ4379@adacore.com> References: <20090901204815.GK4379@adacore.com> <20090902114303.GA30223@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902114303.GA30223@caradoc.them.org> User-Agent: Mutt/1.5.18 (2008-05-17) 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-09/txt/msg00022.txt.bz2 > This almost, almost works. I can see two problems: > > * Can the results of those checks ever change? For instance, does > "set backtrace past-main off" flush the stack frame? If not, it won't > take effect right away after this change. Yes - that's one of the issues I knew about. It wasn't making sense to redo the checks in the case of finding the frame from its ID, but I suppose it would make sense for "bt" to stop after we "set "backtrace past-main off". I suppose we could immediately flush the extra frames when the setting changes to "off", but on the other hand, I think that the right thing to do in frame_find_by_id is to call get_prev_frame_1 anyway. I will test that next. > Have frame_find_by_id keep a cache with the same lifetime as > current_frame. If it saves the last frame it returned, we can try > that frame and the previous frame before going on to searching from > the current frame. That's a good idea. It seems relatively easy to do, since I can see that the current_frame is always reset to NULL through reinit_frame_cache, so it should be easy to have the same lifetime as the frame chain. I will see if I can implement that too. -- Joel