diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2007-01-24 10:49:31 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2007-01-24 10:49:31 +0000 |
commit | 6e2a9270a0ea3be318f176ea87d84a323d2ed239 (patch) | |
tree | 9522a06ed11072f25faf284a2db7a1a0e54eac50 /gdb/testsuite/gdb.mi/mi-var-cp.cc | |
parent | 56163ce1d3a08ade22d84d366dc9066df789914a (diff) | |
download | gdb-6e2a9270a0ea3be318f176ea87d84a323d2ed239.zip gdb-6e2a9270a0ea3be318f176ea87d84a323d2ed239.tar.gz gdb-6e2a9270a0ea3be318f176ea87d84a323d2ed239.tar.bz2 |
Fix computation of the 'editable' attribute and
value changeability for for references.
* varobj.c (get_value_type): New function.
(c_variable_editable): Use get_value_type.
(varobj_value_is_changeable): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-cp.cc')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cp.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc index 33f84e6..6f4fae0 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.cc +++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc @@ -30,6 +30,7 @@ void reference_update_tests () :*/ x = 567; /*: mi_varobj_update RX {} "update RX (3)" + mi_delete_varobj RX "delete RX" :*/ /* Dummy assignment to keep 'x' in scope. */ x = 444; @@ -59,7 +60,8 @@ int base_in_reference_test (S2& s2) mi_check_varobj_value "S2.S.public.i" "67" "check S2.S.public.i" mi_check_varobj_value "S2.S.public.j" "89" "check S2.S.public.j" - + mi_delete_varobj S2 "delete S2" + :*/ /*: END: base_in_reference :*/ } @@ -91,15 +93,39 @@ int reference_to_pointer () mi_check_varobj_value RPTR.public.i 67 "check i member" mi_check_varobj_value RPTR.public.j 89 "check j member" + mi_delete_varobj RPTR "delete RPTR" :*/ return 99; /*: END: reference_to_pointer :*/ } +int reference_to_struct () +{ + /*: BEGIN: reference_to_struct :*/ + S s = {7, 8}; + S& r = s; + /*: + mi_create_varobj S s "create varobj for s" + mi_create_varobj R r "create varobj for s" + mi_gdb_test "-var-show-attributes S" \ + "\\^done,attr=\"noneditable\"" \ + "check attributes of S" + mi_gdb_test "-var-show-attributes R" \ + "\\^done,attr=\"noneditable\"" \ + "check attributes of R" + :*/ + s.i = 56; + /*: mi_varobj_update * [] "-var-update should not list structure varobjs" + :*/ + return 99; + /*: END: reference_to_struct :*/ +} + int main () { reference_update_tests (); base_in_reference_test_main (); reference_to_pointer (); + reference_to_struct (); return 0; } |