/* Helper routines for D support in GDB.
- Copyright (C) 2014-2021 Free Software Foundation, Inc.
+ Copyright (C) 2014-2023 Free Software Foundation, Inc.
This file is part of GDB.
#include "language.h"
#include "namespace.h"
#include "d-lang.h"
-#include "gdb_obstack.h"
+#include "gdbsupport/gdb_obstack.h"
#include "gdbarch.h"
/* This returns the length of first component of NAME, which should be
if (block == NULL)
gdbarch = target_gdbarch ();
else
- gdbarch = block_gdbarch (block);
+ gdbarch = block->gdbarch ();
sym.symbol
= language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
sym.block = NULL;
if (lang_this.symbol == NULL)
return {};
- type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this.symbol)));
+ type = check_typedef (lang_this.symbol->type ()->target_type ());
classname = type->name ();
nested = name;
}
return {};
/* Look for a symbol named NESTED in this class. */
- sym = d_lookup_nested_symbol (SYMBOL_TYPE (class_sym.symbol),
+ sym = d_lookup_nested_symbol (class_sym.symbol->type (),
nested.c_str (), block);
}
the module we're searching in, see if we can find a match by
applying them. */
- for (current = block_using (block);
+ for (current = block->get_using ();
current != NULL;
current = current->next)
{
if (sym.symbol != NULL)
return sym;
- block = BLOCK_SUPERBLOCK (block);
+ block = block->superblock ();
}
return {};
const domain_enum domain)
{
struct block_symbol sym;
- const char *scope = block_scope (block);
+ const char *scope = block == nullptr ? "" : block->scope ();
sym = lookup_module_scope (langdef, name, block, domain, scope, 0);
if (sym.symbol != NULL)