static CORE_ADDR next_address;
-/* Default section to examine next. */
-
-static asection *next_section;
-
/* Last address examined. */
static CORE_ADDR last_examine_address;
static void validate_format (struct format_data, char *);
-static void do_examine (struct format_data, CORE_ADDR addr,
- asection * section);
-
static void print_formatted (struct value *, int, int, struct ui_file *);
static struct format_data decode_format (char **, int, int);
print_formatted (struct value *val, int format, int size,
struct ui_file *stream)
{
- struct type *type = check_typedef (VALUE_TYPE (val));
+ struct type *type = check_typedef (value_type (val));
int len = TYPE_LENGTH (type);
if (VALUE_LVAL (val) == lval_memory)
{
next_address = VALUE_ADDRESS (val) + len;
- next_section = VALUE_BFD_SECTION (val);
}
switch (format)
/* FIXME: Need to handle wchar_t's here... */
next_address = VALUE_ADDRESS (val)
+ val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
- next_section = VALUE_BFD_SECTION (val);
break;
case 'i':
wrap_here (" ");
next_address = VALUE_ADDRESS (val)
+ gdb_print_insn (VALUE_ADDRESS (val), stream);
- next_section = VALUE_BFD_SECTION (val);
break;
default:
with a format. */
void
-print_scalar_formatted (void *valaddr, struct type *type, int format, int size,
- struct ui_file *stream)
+print_scalar_formatted (const void *valaddr, struct type *type,
+ int format, int size, struct ui_file *stream)
{
LONGEST val_long = 0;
unsigned int len = TYPE_LENGTH (type);
if (*cp == '\0')
cp--;
}
- strcpy (buf, local_binary_format_prefix ());
- strcat (buf, cp);
- strcat (buf, local_binary_format_suffix ());
+ strcpy (buf, cp);
fputs_filtered (buf, stream);
}
break;
Fetch it from memory and print on gdb_stdout. */
static void
-do_examine (struct format_data fmt, CORE_ADDR addr, asection *sect)
+do_examine (struct format_data fmt, CORE_ADDR addr)
{
char format = 0;
char size;
size = fmt.size;
count = fmt.count;
next_address = addr;
- next_section = sect;
/* String or instruction format implies fetch single bytes
regardless of the specified size. */
the disassembler be modified so that LAST_EXAMINE_VALUE
is left with the byte sequence from the last complete
instruction fetched from memory? */
- last_examine_value = value_at_lazy (val_type, next_address, sect);
+ last_examine_value = value_at_lazy (val_type, next_address);
if (last_examine_value)
release_value (last_examine_value);
else
val = access_value_history (0);
- if (voidprint || (val && VALUE_TYPE (val) &&
- TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_VOID))
+ if (voidprint || (val && value_type (val) &&
+ TYPE_CODE (value_type (val)) != TYPE_CODE_VOID))
{
int histindex = record_latest_value (val);
if (histindex >= 0)
- annotate_value_history_begin (histindex, VALUE_TYPE (val));
+ annotate_value_history_begin (histindex, value_type (val));
else
- annotate_value_begin (VALUE_TYPE (val));
+ annotate_value_begin (value_type (val));
if (inspect)
printf_unfiltered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
val = evaluate_expression (expr);
- annotate_value_begin (VALUE_TYPE (val));
+ annotate_value_begin (value_type (val));
print_formatted (val, format, fmt.size, gdb_stdout);
*exp = 0;
old_chain = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
- if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
+ if (TYPE_CODE (value_type (val)) == TYPE_CODE_REF)
val = value_ind (val);
/* In rvalue contexts, such as this, functions are coerced into
pointers to functions. This makes "x/i main" work. */
if (/* last_format == 'i' && */
- TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
+ TYPE_CODE (value_type (val)) == TYPE_CODE_FUNC
&& VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val);
else
next_address = value_as_address (val);
- if (VALUE_BFD_SECTION (val))
- next_section = VALUE_BFD_SECTION (val);
do_cleanups (old_chain);
}
- do_examine (fmt, next_address, next_section);
+ do_examine (fmt, next_address);
/* If the examine succeeds, we remember its size and format for next time. */
last_size = fmt.size;
/* Make last address examined available to the user as $_. Use
the correct pointer type. */
struct type *pointer_type
- = lookup_pointer_type (VALUE_TYPE (last_examine_value));
+ = lookup_pointer_type (value_type (last_examine_value));
set_internalvar (lookup_internalvar ("_"),
value_from_pointer (pointer_type,
last_examine_address));
annotate_display_value ();
- do_examine (d->format, addr, VALUE_BFD_SECTION (val));
+ do_examine (d->format, addr);
}
else
{
if (argclass[nargs] == double_arg)
{
- struct type *type = VALUE_TYPE (val_args[nargs]);
+ struct type *type = value_type (val_args[nargs]);
if (TYPE_LENGTH (type) == sizeof (float))
- VALUE_TYPE (val_args[nargs]) = builtin_type_float;
+ val_args[nargs]->type = builtin_type_float;
if (TYPE_LENGTH (type) == sizeof (double))
- VALUE_TYPE (val_args[nargs]) = builtin_type_double;
+ val_args[nargs]->type = builtin_type_double;
}
nargs++;
s = s1;