/* 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
case TYPE_CODE_ENUM:
break;
default:
- target_type = builtin_type_int;
+ target_type = builtin_type_int32;
break;
}
/* 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, " .. ");
the upper bound of the 0 .. -1 range types to be printed as
a very large unsigned number instead of -1.
To workaround this stabs deficiency, we replace the TYPE by
- builtin_type_long when we detect that the bound is negative,
+ builtin_type_int32 when we detect that the bound is negative,
and the type is a TYPE_CODE_INT. The bound is negative when
'm' is the last character of the number scanned in BOUNDS. */
if (bounds[*n - 1] == 'm' && TYPE_CODE (type) == TYPE_CODE_INT)
- type = builtin_type_long;
+ type = builtin_type_int32;
ada_print_scalar (type, B, stream);
if (bounds[*n] == '_')
*n += 2;
char *subtype_info;
if (raw_type == NULL)
- base_type = builtin_type_int;
+ base_type = builtin_type_int32;
else if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE)
base_type = TYPE_TARGET_TYPE (raw_type);
else
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 =