diff options
author | Tom Tromey <tromey@adacore.com> | 2023-08-04 14:00:33 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-05 11:02:34 -0600 |
commit | e1a482ad96a2105c9d3a972de06b510379c14d7e (patch) | |
tree | 74fb69b5da0d49e680680e198c74a668ce4b245c /gdb/rust-lang.h | |
parent | 5cd2b85eba535f3623129f617f331210f62afd76 (diff) | |
download | binutils-e1a482ad96a2105c9d3a972de06b510379c14d7e.zip binutils-e1a482ad96a2105c9d3a972de06b510379c14d7e.tar.gz binutils-e1a482ad96a2105c9d3a972de06b510379c14d7e.tar.bz2 |
Move rust_language::lookup_symbol_nonlocal
This moves rust_language::lookup_symbol_nonlocal to rust-lang.c.
There's no need to have it in rust-lang.h and moving it lets us avoid
adding new includes in a later patch.
Diffstat (limited to 'gdb/rust-lang.h')
-rw-r--r-- | gdb/rust-lang.h | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/gdb/rust-lang.h b/gdb/rust-lang.h index efe721c..85c93a9 100644 --- a/gdb/rust-lang.h +++ b/gdb/rust-lang.h @@ -144,37 +144,7 @@ public: struct block_symbol lookup_symbol_nonlocal (const char *name, const struct block *block, - const domain_enum domain) const override - { - struct block_symbol result = {}; - - const char *scope = block == nullptr ? "" : block->scope (); - symbol_lookup_debug_printf - ("rust_lookup_symbol_non_local (%s, %s (scope %s), %s)", - name, host_address_to_string (block), scope, - domain_name (domain)); - - /* Look up bare names in the block's scope. */ - std::string scopedname; - if (name[cp_find_first_component (name)] == '\0') - { - if (scope[0] != '\0') - { - scopedname = std::string (scope) + "::" + name; - name = scopedname.c_str (); - } - else - name = NULL; - } - - if (name != NULL) - { - result = lookup_symbol_in_static_block (name, block, domain); - if (result.symbol == NULL) - result = lookup_global_symbol (name, block, domain); - } - return result; - } + const domain_enum domain) const override; /* See language.h. */ |