From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18881 invoked by alias); 20 May 2012 13:17:51 -0000 Received: (qmail 18872 invoked by uid 22791); 20 May 2012 13:17:50 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BJ,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; Sun, 20 May 2012 13:17:37 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4KDHO9O008804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 20 May 2012 09:17:24 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4KDHKDE026407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 20 May 2012 09:17:22 -0400 Date: Sun, 20 May 2012 13:17:00 -0000 From: Jan Kratochvil To: John Steele Scott Cc: Tom Tromey , gdb-patches@sourceware.org, Joel Brobecker Subject: Re: [patch] PR symtab/13277: Resolving opaque structures in ICC generated binaries. Message-ID: <20120520131719.GB7416@host2.jankratochvil.net> References: <4EA3E995.8040206@toojays.net> <20111026221057.GA24628@host1.jankratochvil.net> <4EBFB451.8030503@toojays.net> <4FA4912E.9050709@toojays.net> <20120512183722.GA20606@host2.jankratochvil.net> <4FB10DD8.7040501@toojays.net> <20120518144642.GA19690@host2.jankratochvil.net> <4FB8E4BD.6000501@toojays.net> <20120520130919.GA6990@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120520130919.GA6990@host2.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-05/txt/msg00739.txt.bz2 [ Cc to gdb-patches has been lost. ] On Sun, 20 May 2012 15:09:19 +0200, Jan Kratochvil wrote: Hi John, On Sun, 20 May 2012 14:34:05 +0200, John Steele Scott wrote: > basic_lookup_transparent_type will only do one psymbol->symbol expansion per > call. For a frequently referenced opaque type in a non-trivial program, > initially "ptype" will show it as "no data fields". But if I repeatedly > invoke ptype, eventually it resolves the type correctly. sorry I did not write a proper reproducer + testcase for it but I believe the attached patch should fix it. It is probably a regression since introduction of quick_symbol_functions. > On the question of caching the producer info in the dwarf2_cu; I propose to > extract out the second half of producer_is_gxx_lt_4_6 into a new > check_producer function which will set cu->producer_is_gxx_lt_4_6 and > cu->producer_is_icc as appropriate (and then set cu->checked_producer). > producer_is_gxx_lt_4_6 and producer_is_icc will call check_producer if > cu->checked_producer is not set. Sound okay? Yes, I find such approach appropriate. Thanks, Jan gdb/ 2012-05-20 Jan Kratochvil * psymtab.c (lookup_symbol_aux_psymtabs): New variable stab_best. Use it as a fallback for TYPE_IS_OPAQUE. diff --git a/gdb/psymtab.c b/gdb/psymtab.c index e463fff..647368c 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -510,6 +510,7 @@ lookup_symbol_aux_psymtabs (struct objfile *objfile, { struct partial_symtab *ps; const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0); + struct symtab *stab_best = NULL; ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, ps) { @@ -530,13 +531,18 @@ lookup_symbol_aux_psymtabs (struct objfile *objfile, } if (sym && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0) - return stab; + { + if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym))) + return stab; + + stab_best = stab; + } /* Keep looking through other psymtabs. */ } } - return NULL; + return stab_best; } /* Look in PST for a symbol in DOMAIN whose name matches NAME. Search