aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:17:58 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:17:58 +0000
commit22fe0fbb30429cd8f4f086a1da5d4821433e6a41 (patch)
tree8519e22fe2dfc4d366850b7a9cb3410097b80943 /gdb/ada-lang.c
parentd8631d213f802a03c92513bb264b2f4ae65eb259 (diff)
downloadgdb-22fe0fbb30429cd8f4f086a1da5d4821433e6a41.zip
gdb-22fe0fbb30429cd8f4f086a1da5d4821433e6a41.tar.gz
gdb-22fe0fbb30429cd8f4f086a1da5d4821433e6a41.tar.bz2
* valops.c (value_ind): No longer allow dereferencing an
integer type. * eval.c (evaluate_subexp_standard): Handle deferencing an integer type here. * ada-lang.c (ada_evaluate_subexp): Likewise.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 15310ef..75a9828 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -9155,7 +9155,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
}
else if (TYPE_CODE (type) == TYPE_CODE_INT)
/* GDB allows dereferencing an int. */
- return value_zero (builtin_type_int, lval_memory);
+ return value_zero (builtin_type (exp->gdbarch)->builtin_int,
+ lval_memory);
else
error (_("Attempt to take contents of a non-pointer value."));
}
@@ -9165,6 +9166,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
if (ada_is_array_descriptor_type (type))
/* GDB allows dereferencing GNAT array descriptors. */
return ada_coerce_to_simple_array (arg1);
+ else if (TYPE_CODE (type) == TYPE_CODE_INT)
+ /* GDB allows dereferencing an int. */
+ return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int,
+ (CORE_ADDR) value_as_address (arg1));
else
return ada_value_ind (arg1);