(exp->op.get ()));
sym = vvop->get_symbol ();
- if (SYMBOL_CLASS (sym) == LOC_CONST)
+ if (sym->aclass () == LOC_CONST)
{
error (_("constant `%s' (value %s) "
"will not be collected."),
sym->print_name (),
plongest (SYMBOL_VALUE (sym)));
}
- else if (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT)
+ else if (sym->aclass () == LOC_OPTIMIZED_OUT)
{
error (_("`%s' is optimized away "
"and cannot be collected."),
bfd_signed_vma offset;
int treat_as_expr = 0;
- len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
- switch (SYMBOL_CLASS (sym))
+ len = TYPE_LENGTH (check_typedef (sym->type ()));
+ switch (sym->aclass ())
{
default:
printf_filtered ("%s: don't know symbol class %d\n",
- sym->print_name (), SYMBOL_CLASS (sym));
+ sym->print_name (), sym->aclass ());
break;
case LOC_CONST:
printf_filtered ("constant %s (value %s) will not be collected.\n",
}
/* A struct may be a C++ class with static fields, go to general
expression handling. */
- if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_STRUCT)
+ if (sym->type ()->code () == TYPE_CODE_STRUCT)
treat_as_expr = 1;
else
add_memrange (gdbarch, memrange_absolute, offset, len, scope);
add_local_register (gdbarch, reg, scope);
/* Check for doubles stored in two registers. */
/* FIXME: how about larger types stored in 3 or more regs? */
- if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_FLT &&
+ if (sym->type ()->code () == TYPE_CODE_FLT &&
len > register_size (gdbarch, reg))
add_local_register (gdbarch, reg + 1, scope);
break;
}
}
-/* Data to be passed around in the calls to the locals and args
- iterators. */
-
-struct add_local_symbols_data
-{
- struct collection_list *collect;
- struct gdbarch *gdbarch;
- CORE_ADDR pc;
- long frame_regno;
- long frame_offset;
- int count;
- int trace_string;
-};
-
-/* The callback for the locals and args iterators. */
-
-static void
-do_collect_symbol (const char *print_name,
- struct symbol *sym,
- void *cb_data)
-{
- struct add_local_symbols_data *p = (struct add_local_symbols_data *) cb_data;
-
- p->collect->collect_symbol (sym, p->gdbarch, p->frame_regno,
- p->frame_offset, p->pc, p->trace_string);
- p->count++;
-
- p->collect->add_wholly_collected (print_name);
-}
-
void
collection_list::add_wholly_collected (const char *print_name)
{
int trace_string)
{
const struct block *block;
- struct add_local_symbols_data cb_data;
+ int count = 0;
- cb_data.collect = this;
- cb_data.gdbarch = gdbarch;
- cb_data.pc = pc;
- cb_data.frame_regno = frame_regno;
- cb_data.frame_offset = frame_offset;
- cb_data.count = 0;
- cb_data.trace_string = trace_string;
+ auto do_collect_symbol = [&] (const char *print_name,
+ struct symbol *sym)
+ {
+ collect_symbol (sym, gdbarch, frame_regno,
+ frame_offset, pc, trace_string);
+ count++;
+ add_wholly_collected (print_name);
+ };
if (type == 'L')
{
return;
}
- iterate_over_block_local_vars (block, do_collect_symbol, &cb_data);
- if (cb_data.count == 0)
+ iterate_over_block_local_vars (block, do_collect_symbol);
+ if (count == 0)
warning (_("No locals found in scope."));
}
else
return;
}
- iterate_over_block_arg_vars (block, do_collect_symbol, &cb_data);
- if (cb_data.count == 0)
+ iterate_over_block_arg_vars (block, do_collect_symbol);
+ if (count == 0)
warning (_("No args found in scope."));
}
}
printf_filtered ("Line %d of \"%s\"",
sal.line,
symtab_to_filename_for_display (sal.symtab));
- wrap_here (" ");
+ gdb_stdout->wrap_here (2);
printf_filtered (" is at address ");
print_address (get_current_arch (), start_pc, gdb_stdout);
- wrap_here (" ");
+ gdb_stdout->wrap_here (2);
printf_filtered (" but contains no code.\n");
sal = find_pc_line (start_pc, 0);
if (sal.line > 0
error (_("Cannot find a good line."));
}
}
- else
- {
- /* Is there any case in which we get here, and have an address
- which the user would want to see? If we have debugging
- symbols and no line numbers? */
- error (_("Line number %d is out of range for \"%s\"."),
- sal.line, symtab_to_filename_for_display (sal.symtab));
- }
+ else
+ {
+ /* Is there any case in which we get here, and have an address
+ which the user would want to see? If we have debugging
+ symbols and no line numbers? */
+ error (_("Line number %d is out of range for \"%s\"."),
+ sal.line, symtab_to_filename_for_display (sal.symtab));
+ }
/* Find within range of stated line. */
if (args && *args)
gdb_stdout);
else
{
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
default:
case LOC_UNDEF: /* Messed up symbol? */
printf_filtered ("a bogus symbol, class %d.\n",
- SYMBOL_CLASS (sym));
+ sym->aclass ());
count--; /* Don't count this one. */
continue;
case LOC_CONST:
break;
case LOC_CONST_BYTES:
printf_filtered ("constant bytes: ");
- if (SYMBOL_TYPE (sym))
- for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
+ if (sym->type ())
+ for (j = 0; j < TYPE_LENGTH (sym->type ()); j++)
printf_filtered (" %02x",
(unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
break;
regno = SYMBOL_REGISTER_OPS (sym)->register_number (sym,
gdbarch);
- if (SYMBOL_IS_ARGUMENT (sym))
+ if (sym->is_argument ())
printf_filtered ("an argument in register $%s",
gdbarch_register_name (gdbarch, regno));
else
gdb_assert_not_reached ("LOC_COMPUTED variable missing a method");
}
}
- if (SYMBOL_TYPE (sym))
+ if (sym->type ())
{
- struct type *t = check_typedef (SYMBOL_TYPE (sym));
+ struct type *t = check_typedef (sym->type ());
printf_filtered (", length %s.\n", pulongest (TYPE_LENGTH (t)));
}
{
struct symbol *sym;
- char wrap_indent[80];
- char extra_field_indent[80];
struct ui_out *uiout = current_uiout;
symtab_and_line sal;
!tracepoints.empty () ? 'y' : 'n');
uiout->spaces (2);
- strcpy (wrap_indent, " ");
-
+ int wrap_indent = 35;
if (gdbarch_addr_bit (marker.gdbarch) <= 32)
- strcat (wrap_indent, " ");
+ wrap_indent += 11;
else
- strcat (wrap_indent, " ");
+ wrap_indent += 19;
- strcpy (extra_field_indent, " ");
+ const char *extra_field_indent = " ";
uiout->field_core_addr ("addr", marker.gdbarch, marker.address);
static const struct internalvar_funcs sdata_funcs =
{
sdata_make_value,
- NULL,
NULL
};