/* Support for printing Ada types for GDB, the GNU debugger.
Copyright (C) 1986, 1988, 1989, 1991, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+ 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GDB.
}
}
-
-/* Print a description of a type in the format of a
- typedef for the current language.
- NEW is the new name for a type TYPE. */
-
-void
-ada_typedef_print (struct type *type, struct symbol *new,
- struct ui_file *stream)
-{
- /* XXX: type_sprint */
- fprintf_filtered (stream, "type %.*s is ",
- ada_name_prefix_len (SYMBOL_PRINT_NAME (new)),
- SYMBOL_PRINT_NAME (new));
- type_print (type, "", stream, 1);
-}
-
/* Print range type TYPE on STREAM. */
static void
/* We extract the range type bounds respectively from the first element
and the last element of the type->fields array */
const LONGEST lower_bound = (LONGEST) TYPE_LOW_BOUND (type);
- const LONGEST upper_bound =
- (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1);
+ const LONGEST upper_bound = (TYPE_CODE (type) == TYPE_CODE_RANGE
+ ? (LONGEST) TYPE_HIGH_BOUND (type)
+ : (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1));
ada_print_scalar (target_type, lower_bound, stream);
fprintf_filtered (stream, " .. ");
bitsize = 0;
fprintf_filtered (stream, "array (");
+ if (type == NULL)
+ {
+ fprintf_filtered (stream, _("<undecipherable array type>"));
+ return;
+ }
+
n_indices = -1;
if (show < 0)
fprintf_filtered (stream, "...");
else
{
- if (type == NULL)
- {
- fprintf_filtered (stream, _("<undecipherable array type>"));
- return;
- }
if (ada_is_simple_array_type (type))
{
struct type *range_desc_type =