From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113280 invoked by alias); 1 Aug 2019 19:05:48 -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 113267 invoked by uid 89); 1 Aug 2019 19:05:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.9 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=UD:lookup_static_symbol, UD:gdb.lookup_static_symbol, 24474 X-HELO: mail-ot1-f46.google.com Received: from mail-ot1-f46.google.com (HELO mail-ot1-f46.google.com) (209.85.210.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Aug 2019 19:05:47 +0000 Received: by mail-ot1-f46.google.com with SMTP id o101so75452144ota.8 for ; Thu, 01 Aug 2019 12:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FCqZZ22hD70oxWtVlF0JK+IzhG54mkAKPxm9tR5bi1Q=; b=M4LcauyS0XnJ39iRVHCeamrXqYEemW7zxwxz48+2zu082tFgcatMU+r/bmhMqaHQ6H 1IFN62ru1uQxkv5PwZ7FM27MrSSuOEcSc1jxxHKJBNlHVi3CkQ9fz0LsMrjAGGUjIufF zaMAXROgRdkwHJJuLc+eE6/Nmf4jFe5RG4CGddWBF0gGOQJrgbvnHu3TwlEC5FyYoMnx aqqdKRGSsgzTXys0QyiHFPUerfm0VDX9jnvA37ICQCM8CHUv0fBlfKoLGFmvBSnxmN/0 WZLZEk1/DkQHvMRi8tsP/535IC7IhbSGfJrrtvLUOsqTAkVFTyY7/ANM7qKw5V/fAuOH 8Cbw== MIME-Version: 1.0 References: <20190605012421.252953-1-cbiesinger@google.com> <8f4bcc74-18a0-c8f6-b97d-aef05021a656@simark.ca> In-Reply-To: <8f4bcc74-18a0-c8f6-b97d-aef05021a656@simark.ca> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Thu, 01 Aug 2019 19:05:00 -0000 Message-ID: Subject: Re: [PATCH][PR/24474] Make gdb.lookup_static_symbol also check the STATIC_SCOPE To: Simon Marchi Cc: Christian Biesinger via gdb-patches Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-08/txt/msg00032.txt.bz2 On Mon, Jul 15, 2019 at 10:28 PM Simon Marchi wrote: > I am not sure this is the right thing to do, or at least some things need to be > clarified. Global symbols are visible through the entire program (there can only > be one of that name), whereas there can be many static symbols with the same name. > What should the user expect if there are multiple static symbols with the same name? > I suppose we'll return the first one that matches, without any particular guarantee > about which one. By the way, to follow up on that comment-- the symbol cache (or, for that matter, symtab.c:lookup_static_symbol) does not take that into account at all, it will only ever have one cache entry for one static symbol name. In fact it does not even differentiate by objfile, unlike for global symbols (??). Should maybe be fixed someday... Christian