struct cmd_list_element *c,
const char *value)
{
- fprintf_filtered (file, _("Overload resolution in evaluating "
- "C++ functions is %s.\n"),
- value);
+ gdb_printf (file, _("Overload resolution in evaluating "
+ "C++ functions is %s.\n"),
+ value);
}
/* Find the address of function name NAME in the inferior. If OBJF_P
sym = lookup_symbol (name, 0, VAR_DOMAIN, 0);
if (sym.symbol != NULL)
{
- if (SYMBOL_CLASS (sym.symbol) != LOC_BLOCK)
+ if (sym.symbol->aclass () != LOC_BLOCK)
{
error (_("\"%s\" exists in this program but is not a function."),
name);
}
if (objf_p)
- *objf_p = symbol_objfile (sym.symbol);
+ *objf_p = sym.symbol->objfile ();
return value_of_variable (sym.symbol, sym.block);
}
type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char);
type = lookup_function_type (type);
type = lookup_pointer_type (type);
- maddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
+ maddr = msymbol.value_address ();
if (objf_p)
*objf_p = objfile;
if (v)
{
/* Downcasting is possible (t1 is superclass of v2). */
- CORE_ADDR addr2 = value_address (v2);
+ CORE_ADDR addr2 = value_address (v2) + value_embedded_offset (v2);
addr2 -= value_address (v) + value_embedded_offset (v);
return value_at (type, addr2);
struct value *
address_of_variable (struct symbol *var, const struct block *b)
{
- struct type *type = SYMBOL_TYPE (var);
+ struct type *type = var->type ();
struct value *val;
/* Evaluate it first; if the result is a memory address, we're fine.
if (v)
return v;
+ if (current_language->la_language == language_fortran)
+ {
+ /* If it is not a field it is the type name of an inherited
+ structure. */
+ v = search_struct_field (name, *argp, t, 1);
+ if (v)
+ return v;
+ }
+
/* C++: If it was not found as a data field, then try to
return it as a pointer to a method. */
v = search_struct_method (name, argp, args, 0,
the function part. Do not try this for non-functions (e.g.
function pointers). */
if (qualified_name
- && (check_typedef (SYMBOL_TYPE (fsym))->code ()
+ && (check_typedef (fsym->type ())->code ()
== TYPE_CODE_FUNC))
{
temp_func = cp_func_name (qualified_name);
static_offset = oload_method_static_p (methods, ix);
}
else
- nparms = SYMBOL_TYPE (functions[ix])->num_fields ();
+ nparms = functions[ix]->type ()->num_fields ();
parm_types.reserve (nparms);
for (jj = 0; jj < nparms; jj++)
{
type *t = (methods != NULL
? (TYPE_FN_FIELD_ARGS (methods, ix)[jj].type ())
- : SYMBOL_TYPE (functions[ix])->field (jj).type ());
+ : functions[ix]->type ()->field (jj).type ());
parm_types.push_back (t);
}
}
if (overload_debug)
{
if (methods != NULL)
- fprintf_filtered (gdb_stderr,
- "Overloaded method instance %s, # of parms %d\n",
- methods[ix].physname, (int) parm_types.size ());
+ gdb_printf (gdb_stderr,
+ "Overloaded method instance %s, # of parms %d\n",
+ methods[ix].physname, (int) parm_types.size ());
else if (xmethods != NULL)
- fprintf_filtered (gdb_stderr,
- "Xmethod worker, # of parms %d\n",
- (int) parm_types.size ());
+ gdb_printf (gdb_stderr,
+ "Xmethod worker, # of parms %d\n",
+ (int) parm_types.size ());
else
- fprintf_filtered (gdb_stderr,
- "Overloaded function instance "
- "%s # of parms %d\n",
- functions[ix]->demangled_name (),
- (int) parm_types.size ());
+ gdb_printf (gdb_stderr,
+ "Overloaded function instance "
+ "%s # of parms %d\n",
+ functions[ix]->demangled_name (),
+ (int) parm_types.size ());
- fprintf_filtered (gdb_stderr,
- "...Badness of length : {%d, %d}\n",
- bv[0].rank, bv[0].subrank);
+ gdb_printf (gdb_stderr,
+ "...Badness of length : {%d, %d}\n",
+ bv[0].rank, bv[0].subrank);
for (jj = 1; jj < bv.size (); jj++)
- fprintf_filtered (gdb_stderr,
- "...Badness of arg %d : {%d, %d}\n",
- jj, bv[jj].rank, bv[jj].subrank);
+ gdb_printf (gdb_stderr,
+ "...Badness of arg %d : {%d, %d}\n",
+ jj, bv[jj].rank, bv[jj].subrank);
}
if (oload_champ_bv->empty ())
break;
}
if (overload_debug)
- fprintf_filtered (gdb_stderr, "Overload resolution "
- "champion is %d, ambiguous? %d\n",
- oload_champ, oload_ambiguous);
+ gdb_printf (gdb_stderr, "Overload resolution "
+ "champion is %d, ambiguous? %d\n",
+ oload_champ, oload_ambiguous);
}
return oload_champ;
if (sym.symbol == NULL)
return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
- && (SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF))
- result = allocate_value (SYMBOL_TYPE (sym.symbol));
+ && (sym.symbol->aclass () == LOC_TYPEDEF))
+ result = allocate_value (sym.symbol->type ());
else
result = value_of_variable (sym.symbol, sym.block);