CORE_ADDR *address_p)
{
bound_minimal_symbol bound_msym = {msymbol, objfile};
- struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
+ struct obj_section *section = msymbol->obj_section (objfile);
enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
bool is_tls = (section != NULL
return;
}
+/* See parser-defs.h. */
+
+void
+write_exp_symbol_reference (struct parser_state *pstate, const char *name,
+ struct block_symbol sym)
+{
+ if (sym.symbol != nullptr)
+ {
+ if (symbol_read_needs_frame (sym.symbol))
+ pstate->block_tracker->update (sym);
+ write_exp_elt_opcode (pstate, OP_VAR_VALUE);
+ write_exp_elt_block (pstate, sym.block);
+ write_exp_elt_sym (pstate, sym.symbol);
+ write_exp_elt_opcode (pstate, OP_VAR_VALUE);
+ }
+ else
+ {
+ struct bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name);
+ if (msymbol.minsym != NULL)
+ write_exp_msymbol (pstate, msymbol);
+ else if (!have_full_symbols () && !have_partial_symbols ())
+ error (_("No symbol table is loaded. Use the \"file\" command."));
+ else
+ error (_("No symbol \"%s\" in current context."), name);
+ }
+}
const char *
find_template_name_end (const char *p)
for (arg = 0; arg < nargs; arg++)
{
struct type *inst_type = elts[pos + 3 + arg].type;
- struct objfile *inst_objfile = TYPE_OBJFILE (inst_type);
+ struct objfile *inst_objfile = inst_type->objfile_owner ();
if (inst_objfile && (*objfile_func) (inst_objfile, data))
return 1;
const struct block *const block = elts[pos + 1].block;
const struct symbol *const symbol = elts[pos + 2].symbol;
- /* Check objfile where the variable itself is placed.
- SYMBOL_OBJ_SECTION (symbol) may be NULL. */
+ /* Check objfile where the variable itself is placed. */
if ((*objfile_func) (symbol_objfile (symbol), data))
return 1;
/* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL. */
- if (type && TYPE_OBJFILE (type)
- && (*objfile_func) (TYPE_OBJFILE (type), data))
+ if (type != nullptr && type->objfile_owner () != nullptr
+ && objfile_func (type->objfile_owner (), data))
return 1;
+
if (objfile && (*objfile_func) (objfile, data))
return 1;