* p-valprint.c (pascal_val_print): Update.
* jv-valprint.c (java_val_print): Update.
* value.h: Update.
* valprint.c (generic_val_print): Update.
(print_function_pointer_address): Add 'options' argument. Remove
'addressprint' argument. Update.
* m2-valprint.c (print_unpacked_pointer): Update.
* gnu-v3-abi.c (print_one_vtable): Update.
(gnuv3_print_method_ptr): Update.
* f-valprint.c (f_val_print): Update.
* cp-valprint.c (cp_print_value_fields): Update.
* valprint.h (print_function_pointer_address): Update.
* c-valprint.c (c_val_print): Update.
+2012-05-18 Tom Tromey <tromey@redhat.com>
+
+ * printcmd.c (print_address_demangle): Add 'opts' argument.
+ * p-valprint.c (pascal_val_print): Update.
+ * jv-valprint.c (java_val_print): Update.
+ * value.h: Update.
+ * valprint.c (generic_val_print): Update.
+ (print_function_pointer_address): Add 'options' argument. Remove
+ 'addressprint' argument. Update.
+ * m2-valprint.c (print_unpacked_pointer): Update.
+ * gnu-v3-abi.c (print_one_vtable): Update.
+ (gnuv3_print_method_ptr): Update.
+ * f-valprint.c (f_val_print): Update.
+ * cp-valprint.c (cp_print_value_fields): Update.
+ * valprint.h (print_function_pointer_address): Update.
+ * c-valprint.c (c_val_print): Update.
+
2012-05-18 Tom Tromey <tromey@redhat.com>
* psymtab.c (find_pc_sect_symtab_from_partial): Return the symtab
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
- print_function_pointer_address (gdbarch, addr, stream,
- options->addressprint);
+ print_function_pointer_address (options, gdbarch, addr, stream);
break;
}
unresolved_elttype = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_function_pointer_address (gdbarch, addr, stream,
- options->addressprint);
+ print_function_pointer_address (options, gdbarch, addr, stream);
return;
}
CORE_ADDR addr
= extract_typed_address (valaddr + offset, field_type);
- print_function_pointer_address (gdbarch, addr, stream,
- options->addressprint);
+ print_function_pointer_address (options, gdbarch, addr, stream);
}
else
cp_print_value_fields_rtti (type, valaddr,
CORE_ADDR addr;
addr = extract_typed_address (valaddr + i_offset, i_type);
- print_function_pointer_address (get_type_arch (type),
- addr, stream,
- options->addressprint);
+ print_function_pointer_address (options,
+ get_type_arch (type),
+ addr, stream);
}
}
else
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_function_pointer_address (gdbarch, addr, stream,
- options->addressprint);
+ print_function_pointer_address (options, gdbarch, addr, stream);
return;
}
print_longest (stream, 'd', 1, ptr_value);
}
else
- print_address_demangle (gdbarch, ptr_value, stream, demangle);
+ {
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+ print_address_demangle (&opts, gdbarch, ptr_value, stream, demangle);
+ }
if (adjustment)
{
if (ex.reason < 0)
printf_filtered (_("<error: %s>"), ex.message);
else
- print_function_pointer_address (gdbarch, addr, gdb_stdout,
- opts->addressprint);
+ print_function_pointer_address (opts, gdbarch, addr, gdb_stdout);
printf_filtered ("\n");
}
}
if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (gdbarch, addr, stream, demangle);
+ print_address_demangle (options, gdbarch, addr, stream, demangle);
return;
}
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_function_pointer_address (gdbarch, addr, stream,
- options->addressprint);
+ print_function_pointer_address (options, gdbarch, addr, stream);
/* Return value is irrelevant except for string pointers. */
return 0;
}
/* Extract the address, assume that it is unsigned. */
addr = extract_unsigned_integer (valaddr + embedded_offset,
TYPE_LENGTH (type), byte_order);
- print_address_demangle (gdbarch, addr, stream, demangle);
+ print_address_demangle (options, gdbarch, addr, stream, demangle);
break;
}
check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (gdbarch, addr, stream, demangle);
+ print_address_demangle (options, gdbarch, addr, stream, demangle);
return;
}
-fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */
/* Extract the address, assume that it is unsigned. */
print_address_demangle
- (gdbarch,
+ (options, gdbarch,
extract_unsigned_integer (valaddr + embedded_offset
+ TYPE_FIELD_BITPOS (type,
VTBL_FNADDR_OFFSET) / 8,
or not. */
void
-print_address_demangle (struct gdbarch *gdbarch, CORE_ADDR addr,
+print_address_demangle (const struct value_print_options *opts,
+ struct gdbarch *gdbarch, CORE_ADDR addr,
struct ui_file *stream, int do_demangle)
{
- struct value_print_options opts;
-
- get_user_print_options (&opts);
if (addr == 0)
{
fprintf_filtered (stream, "0");
}
- else if (opts.addressprint)
+ else if (opts->addressprint)
{
fputs_filtered (paddress (gdbarch, addr), stream);
print_address_symbolic (gdbarch, addr, stream, do_demangle, " ");
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_function_pointer_address (gdbarch, addr, stream,
- options->addressprint);
+ print_function_pointer_address (options, gdbarch, addr, stream);
return;
}
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
/* Try to print what function it points to, and its address. */
- print_address_demangle (gdbarch, address, stream, demangle);
+ print_address_demangle (options, gdbarch, address, stream, demangle);
break;
case TYPE_CODE_BOOL:
stream STREAM. */
void
-print_function_pointer_address (struct gdbarch *gdbarch,
+print_function_pointer_address (const struct value_print_options *options,
+ struct gdbarch *gdbarch,
CORE_ADDR address,
- struct ui_file *stream,
- int addressprint)
+ struct ui_file *stream)
{
CORE_ADDR func_addr
= gdbarch_convert_from_func_ptr_addr (gdbarch, address,
/* If the function pointer is represented by a description, print
the address of the description. */
- if (addressprint && func_addr != address)
+ if (options->addressprint && func_addr != address)
{
fputs_filtered ("@", stream);
fputs_filtered (paddress (gdbarch, address), stream);
fputs_filtered (": ", stream);
}
- print_address_demangle (gdbarch, func_addr, stream, demangle);
+ print_address_demangle (options, gdbarch, func_addr, stream, demangle);
}
extern void print_char_chars (struct ui_file *, struct type *,
const gdb_byte *, unsigned int, enum bfd_endian);
-extern void print_function_pointer_address (struct gdbarch *gdbarch,
+extern void print_function_pointer_address (const struct value_print_options *options,
+ struct gdbarch *gdbarch,
CORE_ADDR address,
- struct ui_file *stream,
- int addressprint);
+ struct ui_file *stream);
int read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
enum bfd_endian byte_order, gdb_byte **buffer,
struct frame_info;
struct fn_field;
-extern void print_address_demangle (struct gdbarch *, CORE_ADDR,
+extern void print_address_demangle (const struct value_print_options *,
+ struct gdbarch *, CORE_ADDR,
struct ui_file *, int);
extern LONGEST value_as_long (struct value *val);