From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28971 invoked by alias); 27 May 2015 19:21:30 -0000 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 Received: (qmail 28961 invoked by uid 89); 27 May 2015 19:21:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f43.google.com Received: from mail-oi0-f43.google.com (HELO mail-oi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 27 May 2015 19:21:28 +0000 Received: by oifu123 with SMTP id u123so15464116oif.1 for ; Wed, 27 May 2015 12:21:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=sAI24s+yyLUieb8NvXym6e0JLQizdfnQPlslgwQfYkI=; b=X+H9bHO0dTfQjWz1i5GzJQvJfIu5FjOI8/ki8EhubquAB6cuAZ2+ShIKJnEeaS7NSa vI0u34VCcssOlZ7YhM+coXF9fpx0cqu7cYds6uAnSFZ74dGocpy362n0mBqmZyOk8J9o LcXsF62Q+soCFld9Z5KEKUxN4D4xvQXttAUI4MlgFjaJy93ybBj0ByOH1gjFmiq34rFa XNKS3fsH8yZeAKl9jtNlIwwIqXRrrwEktbvD6LCU/8CB5O0RLneH4RwwM42T+hkntd/a j78aE4SwR5SZA7gPgyWSzEE85KI95Kf8nC/+Hnd+i8z3YiWUYb1QcVgctnVLJnf2l2sn Sfpg== X-Gm-Message-State: ALoCoQkdFy80yqdJaHN5ZnO/edxYGnR57U4p8WXTAnbndYq3QO7JVPkfGKKNLwMlBNbsks0xnXy0 MIME-Version: 1.0 X-Received: by 10.182.24.97 with SMTP id t1mr27670138obf.32.1432754486098; Wed, 27 May 2015 12:21:26 -0700 (PDT) Received: by 10.182.89.99 with HTTP; Wed, 27 May 2015 12:21:26 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 May 2015 19:21:00 -0000 Message-ID: Subject: Re: [PATCH] add domain arg to cp_lookup_nested_symbol_1 From: Doug Evans To: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00667.txt.bz2 On Mon, May 18, 2015 at 1:00 PM, Doug Evans wrote: > Hi. > > This patch is a cleanup of one bit of cp-namespace.c that I've wanted > to make, but didn't have the impetus until now. > > This isn't something I introduced. > E.g., in 7.6.2 cp-namespace.c:lookup_symbol_file calls > cp_lookup_nested_symbol, ignoring the requested domain of its caller. > > The "domain" of a symbol is an integral part of symbol lookup > (e.g., in C do I look up "foo" as a plain variable or as a struct?). > In c++ the waters are a bit muddy because "class c" in STRUCT_DOMAIN > also creates symbol "c" in VAR_DOMAIN. > The calls to cp_lookup_nested_symbol_1 were ignoring the incoming > domain and hardcoding a lookup in VAR_DOMAIN. > It may be ok to get away with this, at least most of the time, > but it can create confusion. > > Regression tested on amd64-linux. > > 2015-05-18 Doug Evans > > * cp-namespace.c (cp_lookup_nested_symbol): New arg "domain". > All callers updated. > (cp_lookup_nested_symbol_1, find_symbol_in_baseclass): Ditto. > * cp-support.h (cp_lookup_nested_symbol): Update. Committed.