From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30503 invoked by alias); 14 Apr 2004 19:10:10 -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 30432 invoked from network); 14 Apr 2004 19:10:08 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 14 Apr 2004 19:10:08 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3EJA8u6008696 for ; Wed, 14 Apr 2004 15:10:08 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3EJA5j20999; Wed, 14 Apr 2004 15:10:06 -0400 To: Joel Brobecker Cc: Daniel Jacobowitz , Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [RFC/dwarf-2] Add support for included files References: <20040413052021.GA1173@gnat.com> From: Jim Blandy Date: Wed, 14 Apr 2004 19:10:00 -0000 In-Reply-To: <20040413052021.GA1173@gnat.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-04/txt/msg00293.txt.bz2 Okay, let's take it as established that the speed impact is not too bad. Given the improved accuracy, I think it's worth taking the chance that we'll have to revisit it. Could you try one more thing for me? As you noticed, the only two functions that dwarf_decode_lines calls to actually record the information it gets are buildsym.c:start_subfile (via dwarf2_start_subfile) and buildsym.c:record_line. Could you change dwarf_decode_lines to take two function pointers (with an accompanying closure pointer) for those two functions? I guess this is an instance of the 'builder' pattern, so maybe name it something appropriately suggestive. Let dwarf_decode_lines continue to call dwarf2_start_subfile directly, just passing the builder func and closure along with filename and dirname. Then, instead of duplicating dwarf_decode_lines, have the existing call in read_file_scope and the new call you've added just pass different function/closures to it. If it's easy, re-run your speed tests to make sure this doesn't make some mysterious difference.