diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-01-08 17:40:09 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-01-08 17:40:09 +0000 |
commit | a84a8a0d30b375691d864cf8d842fa19354e7e20 (patch) | |
tree | 860a3ce338ddc7c12fe126c23166274bbf7a48a8 | |
parent | 7eebcca8bd83b759da622cb306868147ce5b9312 (diff) | |
download | gdb-a84a8a0d30b375691d864cf8d842fa19354e7e20.zip gdb-a84a8a0d30b375691d864cf8d842fa19354e7e20.tar.gz gdb-a84a8a0d30b375691d864cf8d842fa19354e7e20.tar.bz2 |
* ada-lang.c (ensure_lval): Fix value lval kind.
(convert_actual): Add handling for arguments passed by reference.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ada-lang.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5adc048..b1a2c92 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-01-08 Paul Hilfinger <hilfinger@adacore.com> + + * ada-lang.c (ensure_lval): Fix value lval kind. + (convert_actual): Add handling for arguments passed by reference. + 2008-01-08 Doug Evans <dje@google.com> * dbxread.c (read_dbx_symtab): Fix indentation. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a689b2e..2d1ce2f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3822,6 +3822,7 @@ ensure_lval (struct value *val, CORE_ADDR *sp) if (gdbarch_frame_align_p (current_gdbarch)) *sp = gdbarch_frame_align (current_gdbarch, *sp); } + VALUE_LVAL (val) = lval_memory; write_memory (VALUE_ADDRESS (val), value_contents_raw (val), len); } @@ -3850,11 +3851,13 @@ convert_actual (struct value *actual, struct type *formal_type0, if (ada_is_array_descriptor_type (formal_target) && TYPE_CODE (actual_target) == TYPE_CODE_ARRAY) return make_array_descriptor (formal_type, actual, sp); - else if (TYPE_CODE (formal_type) == TYPE_CODE_PTR) + else if (TYPE_CODE (formal_type) == TYPE_CODE_PTR + || TYPE_CODE (formal_type) == TYPE_CODE_REF) { + struct value *result; if (TYPE_CODE (formal_target) == TYPE_CODE_ARRAY && ada_is_array_descriptor_type (actual_target)) - return desc_data (actual); + result = desc_data (actual); else if (TYPE_CODE (actual_type) != TYPE_CODE_PTR) { if (VALUE_LVAL (actual) != lval_memory) @@ -3867,8 +3870,11 @@ convert_actual (struct value *actual, struct type *formal_type0, TYPE_LENGTH (actual_type)); actual = ensure_lval (val, sp); } - return value_addr (actual); + result = value_addr (actual); } + else + return actual; + return value_cast_pointers (formal_type, result); } else if (TYPE_CODE (actual_type) == TYPE_CODE_PTR) return ada_value_ind (actual); |