From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27532 invoked by alias); 23 Apr 2010 23:03:30 -0000 Received: (qmail 27402 invoked by uid 22791); 23 Apr 2010 23:03:29 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Apr 2010 23:03:24 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3NN3Nnl021624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Apr 2010 19:03:23 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3NN3MEB016906; Fri, 23 Apr 2010 19:03:22 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o3NN3Lhe012382; Fri, 23 Apr 2010 19:03:21 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 18E4437849C; Fri, 23 Apr 2010 17:03:21 -0600 (MDT) From: Tom Tromey To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Delayed physname computation References: <4BCE0D3C.7040201@redhat.com> Reply-To: tromey@redhat.com Date: Fri, 23 Apr 2010 23:03:00 -0000 In-Reply-To: <4BCE0D3C.7040201@redhat.com> (Keith Seitz's message of "Tue, 20 Apr 2010 13:23:24 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00822.txt.bz2 >>>>> "Keith" == Keith Seitz writes: Keith> The solution I've implemented is to simply delay processing of method Keith> physnames until the entire CU has been read/processed. I read through this and I think it looks good. I do have some questions, nothing major. Keith> Unfortunately, this is another example in which the compiler used may Keith> alter the test outcome. As a result, I've had to hack in a test case Keith> which is independent of the compiler. I would appreciate special Keith> attention to the test source file (pr11465.S), which is an edited Keith> version of gcc's --save-temps output. This sort of thing is fine, there are other tests made the same way. I didn't try to read the assembly, but Jan's updated test is ok when this patch goes in. Keith> +static void Keith> +add_to_method_list (struct type *type, int fnfield_index, int index, Keith> + const char *name, struct die_info *die, Keith> + struct dwarf2_cu *cu) This needs some kind of header comment. It can be pretty mild. Keith> + physname = (char *) dwarf2_physname ((char *) mi->name, mi->die, cu); It would be nice to make all this stuff const-correct. It is definitely not needed for this patch, I just didn't notice this earlier. Keith> + /* If methods were found in the partial symbol table, we allocate one Keith> + big buffer to hold the entire delayed list for the CU. */ Keith> + if (per_cu->num_methods) Keith> + { Keith> + cu->method_list Keith> + = xmalloc (per_cu->num_methods * sizeof (struct delayed_method_info)); Keith> + } I didn't go dig through the code, so consider this a conditional request. If we are careful about cleanups here, then this needs a cleanup; otherwise an error results in a memory leak. If we aren't already careful, then don't bother, I think we will need to make a pass through this to make the reader a bit more robust in the face of weird DWARF. In this case, either file a bug or let me know and I will file one. Keith> complaint (&symfile_complaints, _("member function type missing for '%s'"), Keith> - physname); Keith> + dwarf2_physname (fieldname, die, cu)); Can this call to dwarf2_physname exhibit the problem that this patch is trying to circumvent? Tom