/* Support for printing Fortran values for GDB, the GNU debugger.
Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003, 2005, 2006,
- 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C definitions by Farooq Butt
(fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs.
{
int upper_bound = -1;
int lower_bound = 1;
- int retcode;
/* Recursively go all the way down into a possibly multi-dimensional
F77 array and get the bounds. For simple arrays, this is pretty
struct type *tmp_type;
int eltlen;
int ndimen = 1;
- int upper, lower, retcode;
+ int upper, lower;
tmp_type = type;
CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned int i = 0; /* Number of characters printed */
struct type *elttype;
LONGEST val;
{
case TYPE_CODE_STRING:
f77_get_dynamic_length_of_aggregate (type);
- LA_PRINT_STRING (stream, builtin_type (current_gdbarch)->builtin_char,
- valaddr, TYPE_LENGTH (type), 0, options);
+ LA_PRINT_STRING (stream, builtin_type (gdbarch)->builtin_char,
+ valaddr, TYPE_LENGTH (type), NULL, 0, options);
break;
case TYPE_CODE_ARRAY:
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
+ print_address_demangle (gdbarch, addr, stream, demangle);
/* Return value is irrelevant except for string pointers. */
return 0;
}
if (options->addressprint && options->format != 's')
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
+
fprintf_filtered (stream, "@");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
fputs_filtered (": ", stream);
}
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
struct value *deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (type, valaddr + embedded_offset));
+ value_at
+ (TYPE_TARGET_TYPE (type),
+ unpack_pointer (type, valaddr + embedded_offset));
+
common_val_print (deref_val, stream, recurse,
options, current_language);
}
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
/* Try to print what function it points to, and its address. */
- print_address_demangle (address, stream, demangle);
+ print_address_demangle (gdbarch, address, stream, demangle);
break;
case TYPE_CODE_INT:
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr, type, &opts, 0, stream);
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr, type, &opts, 0, stream);
}
else
{
- val = extract_unsigned_integer (valaddr, TYPE_LENGTH (type));
-
+ val = extract_unsigned_integer (valaddr,
+ TYPE_LENGTH (type), byte_order);
if (val == 0)
fprintf_filtered (stream, ".FALSE.");
else if (val == 1)
for (index = 0; index < TYPE_NFIELDS (type); index++)
{
int offset = TYPE_FIELD_BITPOS (type, index) / 8;
+
f_val_print (TYPE_FIELD_TYPE (type, index), valaddr + offset,
embedded_offset, address, stream, recurse, options);
if (index != TYPE_NFIELDS (type) - 1)
else
{
struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (get_frame_pc (fi));
+ lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL)
funname = SYMBOL_LINKAGE_NAME (msymbol);
else
{
struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (fi->pc);
+ lookup_minimal_symbol_by_pc (fi->pc);
if (msymbol != NULL)
funname = SYMBOL_LINKAGE_NAME (msymbol);