From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32238 invoked by alias); 26 Jul 2010 18:47:26 -0000 Received: (qmail 32227 invoked by uid 22791); 26 Jul 2010 18:47:25 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,TW_CP,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; Mon, 26 Jul 2010 18:47:21 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6QIlJt8011971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 26 Jul 2010 14:47:20 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6QIlHbp007482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 26 Jul 2010 14:47:19 -0400 Message-ID: <4C4DD835.7060702@redhat.com> Date: Mon, 26 Jul 2010 18:47:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [RFA] Change to pre-expand symtabs Content-Type: multipart/mixed; boundary="------------050206010700030409030106" X-IsSubscribed: yes 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-07/txt/msg00398.txt.bz2 This is a multi-part message in MIME format. --------------050206010700030409030106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1000 Hi, This patch actually does two things, both related to PR symtab/11743 (for which I've previously submitted various ugly patches). First, it switches gdb to search for symtabs by using psymtab pre-expansion. Second, it strips off overload information from psymtab search names, since psymtabs do not contain any of this information to begin with. I believe this is going to be the cleanest approach to fixing the overload-instance-in-a-psymtab problem (symtab/11743) that we're likely to find. Note that I have not addressed the linespec.c problems specifically reported in symtab/11743. This simply gets the non-quoted case working (which is a pre-requisite anyway). Keith ChangeLog 2010-07-26 Keith Seitz PR symtab/11743 (partial): * psymtab.c (lookup_symbol_aux_psymtabs): Always return NULL; switching to pre-expanding symtabs instead. (pre_expand_symtabs_matching_psymtabs): Implement. If overload information is present in the search name, strip it. --------------050206010700030409030106 Content-Type: text/plain; name="expand-psymtabs-overloaded.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="expand-psymtabs-overloaded.patch" Content-length: 1526 Index: psymtab.c =================================================================== RCS file: /cvs/src/src/gdb/psymtab.c,v retrieving revision 1.7 diff -u -p -r1.7 psymtab.c --- psymtab.c 13 Jul 2010 20:52:52 -0000 1.7 +++ psymtab.c 26 Jul 2010 18:38:24 -0000 @@ -409,15 +409,6 @@ lookup_symbol_aux_psymtabs (struct objfi int block_index, const char *name, const domain_enum domain) { - struct partial_symtab *ps; - const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0); - - ALL_OBJFILE_PSYMTABS (objfile, ps) - { - if (!ps->readin && lookup_partial_symbol (ps, name, psymtab_index, domain)) - return PSYMTAB_TO_SYMTAB (ps); - } - return NULL; } @@ -426,7 +417,27 @@ pre_expand_symtabs_matching_psymtabs (st int kind, const char *name, domain_enum domain) { - /* Nothing. */ + char *paren; + struct partial_symtab *pst; + const int psymtab_index = (kind == GLOBAL_BLOCK ? 1 : 0); + + /* If NAME contains overload information, strip it, since psymtabs only + contain the method name. */ + paren = strchr (name, '('); + if (paren != NULL) + { + char *tmp = alloca (strlen (name)); + memcpy (tmp, name, paren - name); + tmp[name - paren] = '\0'; + name = tmp; + } + + ALL_OBJFILE_PSYMTABS (objfile, pst) + { + if (!pst->readin + && lookup_partial_symbol (pst, name, psymtab_index, domain) != NULL) + PSYMTAB_TO_SYMTAB (pst); + } } /* Look, in partial_symtab PST, for symbol whose natural name is NAME. --------------050206010700030409030106--