From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9914 invoked by alias); 3 Nov 2010 01:41:01 -0000 Received: (qmail 9903 invoked by uid 22791); 3 Nov 2010 01:41:00 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.windriver.com (HELO mail.windriver.com) (147.11.1.11) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Nov 2010 01:40:56 +0000 Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id oA31eg4w005502; Tue, 2 Nov 2010 18:40:42 -0700 (PDT) Received: from ala-mail06.corp.ad.wrs.com ([147.11.57.147]) by ALA-MAIL03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 2 Nov 2010 18:40:41 -0700 Received: from [128.224.158.168] ([128.224.158.168]) by ala-mail06.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 2 Nov 2010 18:40:42 -0700 Message-ID: <4CD0BDCB.1040405@windriver.com> Date: Wed, 03 Nov 2010 01:41:00 -0000 From: "Liu, Lei" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH] call cp_lookup_symbol_namespace recursively to search symbols in C++ base classes References: <4CCF89F0.5090100@windriver.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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-11/txt/msg00058.txt.bz2 On 2010年11月03日 03:48, Tom Tromey wrote: >>>>>> ">" == Liu, Lei writes: > >>> This patch is trying to fix a bug in gdb. The problem is found in >>> following C++ test case. > > Thanks. > > This looks pretty reasonable overall. In order for it to go in, we > would need a couple things: > > * Copyright assignment forms filed with the FSF. If you don't have this > already, one of us can get you started. I don't have this yet. We can get start to do it. > > * A test case -- the one you have is fine, it just needs to be in the > form used by our test suite. Right. I'll reform it. > >>> 2010-11-02 Lei Liu > >>> * cp-namespace.c (cp_lookup_symbol_namespace): Recursively call >>> itself to search C++ base classes. > > It isn't 100% clear to me that cp_lookup_symbol_namespace is the right > function. That file is kind of spaghetti-ish right now :( It seems to me that all the C++ specific symbol looking up code are located in this file. I don't know where else I can put my code in. > >>> + scope_sym = lookup_symbol (scope, NULL, VAR_DOMAIN, NULL); >>> + if (scope_sym == NULL) >>> + return NULL; >>> + >>> + scope_type = SYMBOL_TYPE(scope_sym); >>> + if (scope_type == NULL) >>> + return NULL; > > I think lookup_typename is better here. Well, I tried that first, but we must have a GDBARCH passed to it. I'm not sure where can I get this. > >>> + if (TYPE_CODE (scope_type) == TYPE_CODE_STRUCT) > > I think you should call check_typedef on scope_type before this check. OK. I missed that. > > thanks, > Tom > Thanks. Lei