From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 1/5] Remove add_symbols_from_enclosing_procs
Date: Fri, 16 Jul 2021 13:17:46 -0600 [thread overview]
Message-ID: <20210716191750.2619599-2-tromey@adacore.com> (raw)
In-Reply-To: <20210716191750.2619599-1-tromey@adacore.com>
I noticed that add_symbols_from_enclosing_procs is empty, and can be
removed. The one caller, ada_add_local_symbols, can also be
simplified, removing some code that, I think, was an incorrect attempt
to handle nested functions.
---
gdb/ada-lang.c | 30 ++----------------------------
1 file changed, 2 insertions(+), 28 deletions(-)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index b098991612d..f45384a68cb 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4522,19 +4522,6 @@ ada_lookup_simple_minsym (const char *name)
return result;
}
-/* For all subprograms that statically enclose the subprogram of the
- selected frame, add symbols matching identifier NAME in DOMAIN
- and their blocks to the list of data in RESULT, as for
- ada_add_block_symbols (q.v.). If WILD_MATCH_P, treat as NAME
- with a wildcard prefix. */
-
-static void
-add_symbols_from_enclosing_procs (std::vector<struct block_symbol> &result,
- const lookup_name_info &lookup_name,
- domain_enum domain)
-{
-}
-
/* True if TYPE is definitely an artificial type supplied to a symbol
for which no debugging information was given in the symbol file. */
@@ -4937,25 +4924,17 @@ remove_irrelevant_renamings (std::vector<struct block_symbol> *syms,
}
/* Add to RESULT all symbols from BLOCK (and its super-blocks)
- whose name and domain match NAME and DOMAIN respectively.
- If no match was found, then extend the search to "enclosing"
- routines (in other words, if we're inside a nested function,
- search the symbols defined inside the enclosing functions).
- If WILD_MATCH_P is nonzero, perform the naming matching in
- "wild" mode (see function "wild_match" for more info).
+ whose name and domain match LOOKUP_NAME and DOMAIN respectively.
- Note: This function assumes that RESULT has 0 (zero) element in it. */
+ Note: This function assumes that RESULT is empty. */
static void
ada_add_local_symbols (std::vector<struct block_symbol> &result,
const lookup_name_info &lookup_name,
const struct block *block, domain_enum domain)
{
- int block_depth = 0;
-
while (block != NULL)
{
- block_depth += 1;
ada_add_block_symbols (result, block, lookup_name, domain, NULL);
/* If we found a non-function match, assume that's the one. */
@@ -4964,11 +4943,6 @@ ada_add_local_symbols (std::vector<struct block_symbol> &result,
block = BLOCK_SUPERBLOCK (block);
}
-
- /* If no luck so far, try to find NAME as a local symbol in some lexically
- enclosing subprogram. */
- if (result.empty () && block_depth > 2)
- add_symbols_from_enclosing_procs (result, lookup_name, domain);
}
/* An object of this type is used as the callback argument when
--
2.26.3
next prev parent reply other threads:[~2021-07-16 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-16 19:17 [PATCH 0/5] Fix Ada qualification bug Tom Tromey
2021-07-16 19:17 ` Tom Tromey [this message]
2021-07-16 19:17 ` [PATCH 2/5] Refactor Ada resolution Tom Tromey
2021-07-16 19:17 ` [PATCH 3/5] Defer Ada character literal resolution Tom Tromey
2021-07-16 19:17 ` [PATCH 4/5] Remove the type_qualifier global Tom Tromey
2021-07-16 19:17 ` [PATCH 5/5] Handle type qualifier for enumeration name Tom Tromey
2021-08-02 16:22 ` [PATCH 0/5] Fix Ada qualification bug Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210716191750.2619599-2-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).