From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3973 invoked by alias); 2 Nov 2010 20:31:24 -0000 Received: (qmail 3953 invoked by uid 22791); 2 Nov 2010 20:31:19 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,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; Tue, 02 Nov 2010 20:31:11 +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.13.8/8.13.8) with ESMTP id oA2KVASN014785 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Nov 2010 16:31:10 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA2KV7eH005579; Tue, 2 Nov 2010 16:31:07 -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 oA2KV5F1009418; Tue, 2 Nov 2010 16:31:06 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 10CDD8880C9; Tue, 2 Nov 2010 13:48:43 -0600 (MDT) From: Tom Tromey To: "Liu\, Lei" 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> Date: Tue, 02 Nov 2010 20:31:00 -0000 In-Reply-To: <4CCF89F0.5090100@windriver.com> (Lei Liu's message of "Tue, 02 Nov 2010 11:48:00 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (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-11/txt/msg00051.txt.bz2 >>>>> ">" == 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. * A test case -- the one you have is fine, it just needs to be in the form used by our test suite. >> 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 :( >> + 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. >> + if (TYPE_CODE (scope_type) == TYPE_CODE_STRUCT) I think you should call check_typedef on scope_type before this check. thanks, Tom