aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-29 17:30:12 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-29 17:30:12 +0000
commit7c964f079e2404c667e3e4ffb32a380590c438ab (patch)
tree7f68c7f861da1ed02480300e7236211278082899 /gdb/ada-lang.c
parent1ce677a4a194224337e88b3b6d365b5dd66714bd (diff)
downloadgdb-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-lang.c')
-rw-r--r--gdb/ada-lang.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 13d10d9..ad08c5f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5648,18 +5648,14 @@ ada_is_variant_part (struct type *type, int field_num)
/* Assuming that VAR_TYPE is a variant wrapper (type of the variant part)
whose discriminants are contained in the record type OUTER_TYPE,
- returns the type of the controlling discriminant for the variant. */
+ returns the type of the controlling discriminant for the variant.
+ May return NULL if the type could not be found. */
struct type *
ada_variant_discrim_type (struct type *var_type, struct type *outer_type)
{
char *name = ada_variant_discrim_name (var_type);
- struct type *type =
- ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
- if (type == NULL)
- return builtin_type_int32;
- else
- return type;
+ return ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
}
/* Assuming that TYPE is the type of a variant wrapper, and FIELD_NUM is a