From patchwork Thu Dec 18 12:22:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 4341 Received: (qmail 30205 invoked by alias); 18 Dec 2014 12:23:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 30192 invoked by uid 89); 18 Dec 2014 12:23:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f179.google.com Received: from mail-pd0-f179.google.com (HELO mail-pd0-f179.google.com) (209.85.192.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 18 Dec 2014 12:23:38 +0000 Received: by mail-pd0-f179.google.com with SMTP id fp1so1319292pdb.24 for ; Thu, 18 Dec 2014 04:23:36 -0800 (PST) X-Received: by 10.68.189.71 with SMTP id gg7mr2851751pbc.21.1418905416666; Thu, 18 Dec 2014 04:23:36 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id i5sm6774800pat.6.2014.12.18.04.23.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 04:23:33 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH 2/6] [PR 17684] lookup_symbol_nonlocal routines get langdef parameter Date: Thu, 18 Dec 2014 04:22:42 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes This patch adds a new langdef parameter to la_lookup_symbol_nonlocal language "methods". 2014-12-18 Doug Evans * language.h (struct language_defn) : New arg language_defn. All uses updated. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index f453ef0..5d4ea2f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5585,7 +5585,8 @@ ada_lookup_symbol (const char *name, const struct block *block0, } static struct symbol * -ada_lookup_symbol_nonlocal (const char *name, +ada_lookup_symbol_nonlocal (const struct language_defn *langdef, + const char *name, const struct block *block, const domain_enum domain) { diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 0cbf902..6599d45 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -798,7 +798,8 @@ lookup_namespace_scope (const char *name, DOMAIN says what kind of symbols we're looking for. */ struct symbol * -cp_lookup_symbol_nonlocal (const char *name, +cp_lookup_symbol_nonlocal (const struct language_defn *langdef, + const char *name, const struct block *block, const domain_enum domain) { diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 2594e34..783bdf0 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -192,9 +192,11 @@ extern void cp_add_using_directive (const char *dest, extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol, struct objfile *objfile); -extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, - const struct block *block, - const domain_enum domain); +extern struct symbol *cp_lookup_symbol_nonlocal + (const struct language_defn *langdef, + const char *name, + const struct block *block, + const domain_enum domain); extern struct symbol *cp_lookup_symbol_namespace (const char *namespace, const char *name, diff --git a/gdb/language.h b/gdb/language.h index aa07d8d..2a47e64 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -262,7 +262,8 @@ struct language_defn the part of symbol lookup where C looks up static and global variables. */ - struct symbol *(*la_lookup_symbol_nonlocal) (const char *, + struct symbol *(*la_lookup_symbol_nonlocal) (const struct language_defn *, + const char *, const struct block *, const domain_enum); diff --git a/gdb/symtab.c b/gdb/symtab.c index 1b9ea06..7d2cde5 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1485,7 +1485,7 @@ lookup_symbol_aux (const char *name, const struct block *block, /* Now do whatever is appropriate for LANGUAGE to look up static and global variables. */ - sym = langdef->la_lookup_symbol_nonlocal (name, block, domain); + sym = langdef->la_lookup_symbol_nonlocal (langdef, name, block, domain); if (sym != NULL) { if (symbol_lookup_debug) @@ -1805,7 +1805,8 @@ lookup_symbol_via_quick_fns (struct objfile *objfile, int block_index, /* See symtab.h. */ struct symbol * -basic_lookup_symbol_nonlocal (const char *name, +basic_lookup_symbol_nonlocal (const struct language_defn *langdef, + const char *name, const struct block *block, const domain_enum domain) { diff --git a/gdb/symtab.h b/gdb/symtab.h index d195222..57ed9fc 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1186,9 +1186,11 @@ extern struct symbol *lookup_symbol (const char *, const struct block *, that can't think of anything better to do. This implements the C lookup rules. */ -extern struct symbol *basic_lookup_symbol_nonlocal (const char *, - const struct block *, - const domain_enum); +extern struct symbol * + basic_lookup_symbol_nonlocal (const struct language_defn *langdef, + const char *, + const struct block *, + const domain_enum); /* Some helper functions for languages that need to write their own lookup_symbol_nonlocal functions. */