diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-06-29 17:30:12 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-06-29 17:30:12 +0000 |
commit | 7c964f079e2404c667e3e4ffb32a380590c438ab (patch) | |
tree | 7f68c7f861da1ed02480300e7236211278082899 /gdb/ada-valprint.c | |
parent | 1ce677a4a194224337e88b3b6d365b5dd66714bd (diff) | |
download | gdb-7c964f079e2404c667e3e4ffb32a380590c438ab.zip gdb-7c964f079e2404c667e3e4ffb32a380590c438ab.tar.gz gdb-7c964f079e2404c667e3e4ffb32a380590c438ab.tar.bz2 |
* ada-valprint.c (ada_print_scalar): Accept NULL type argument
to indicate scalar should be printed as default integer.
(print_optional_low_bound): Pass NULL to ada_print_scalar to
indicate default integer output.
* ada-typeprint.c (print_range, print_range_bound): Likewise.
(print_choices): Likewise. Thus, accept NULL as val_type.
* ada-lang.c (ada_variant_discrim_type): Return NULL when failed
to look up controlling discriminant name.
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r-- | gdb/ada-valprint.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index a6f3f48..b33199b 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -122,7 +122,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type, return 0; break; case TYPE_CODE_UNDEF: - index_type = builtin_type_int32; + index_type = NULL; /* FALL THROUGH */ default: if (low_bound == 1) @@ -375,7 +375,8 @@ ada_printchar (int c, struct type *type, struct ui_file *stream) } /* [From print_type_scalar in typeprint.c]. Print VAL on STREAM in a - form appropriate for TYPE. */ + form appropriate for TYPE, if non-NULL. If TYPE is NULL, print VAL + like a default signed integer. */ void ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) @@ -383,6 +384,12 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) unsigned int i; unsigned len; + if (!type) + { + print_longest (stream, 'd', 0, val); + return; + } + type = ada_check_typedef (type); switch (TYPE_CODE (type)) |