diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-03-13 00:57:52 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-03-13 00:57:52 +0000 |
commit | b79819baf724fdf9e33c9d853a57e0abeca29b05 (patch) | |
tree | fe43f5c8ed2271e5e1e73737da43cb43ab058a70 | |
parent | ef6f706809dd770d9be48f16dabe6b13aa1ab07b (diff) | |
download | gdb-b79819baf724fdf9e33c9d853a57e0abeca29b05.zip gdb-b79819baf724fdf9e33c9d853a57e0abeca29b05.tar.gz gdb-b79819baf724fdf9e33c9d853a57e0abeca29b05.tar.bz2 |
* ada-lang.c (ada_evaluate_subexp) [OP_VAR_VALUE]: For tagged
types, if we are unable to determine the actual symbol type
from its tag, then use the static approximation instead.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/ada-lang.c | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7ddb7d1..d3e9c2c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2009-03-12 Joel Brobecker <brobecker@adacore.com> + * ada-lang.c (ada_evaluate_subexp) [OP_VAR_VALUE]: For tagged + types, if we are unable to determine the actual symbol type + from its tag, then use the static approximation instead. + +2009-03-12 Joel Brobecker <brobecker@adacore.com> + Fix crash printing packed record with packed array. * ada-lang.c (ada_modulus_from_name): New function. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6988594..0724804 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -8576,8 +8576,19 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, a fixed type would result in the loss of that type name, thus preventing us from printing the name of the ancestor type in the type description. */ + struct type *actual_type; + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); - return value_zero (type_from_tag (ada_value_tag (arg1)), not_lval); + actual_type = type_from_tag (ada_value_tag (arg1)); + if (actual_type == NULL) + /* If, for some reason, we were unable to determine + the actual type from the tag, then use the static + approximation that we just computed as a fallback. + This can happen if the debugging information is + incomplete, for instance. */ + actual_type = type; + + return value_zero (actual_type, not_lval); } *pos += 4; |