diff options
author | Jim Ingham <jingham@apple.com> | 2000-03-13 21:51:46 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2000-03-13 21:51:46 +0000 |
commit | 73a93a3251211bf8c5774282e41dbc023820404a (patch) | |
tree | d1cedff69c4d1306c93cc4bfb59d4719026200b6 /gdb/testsuite/gdb.mi/mi-var-cmd.exp | |
parent | 271bb601c426b043736a308b1a5f6d36bb47857a (diff) | |
download | fsf-binutils-gdb-73a93a3251211bf8c5774282e41dbc023820404a.zip fsf-binutils-gdb-73a93a3251211bf8c5774282e41dbc023820404a.tar.gz fsf-binutils-gdb-73a93a3251211bf8c5774282e41dbc023820404a.tar.bz2 |
2000-03-13 James Ingham <jingham@leda.cygnus.com>
Add support for a variable object that tries to evaluate itself in
the currently selected frame, rather than in a fixed frame.
* wrapper.c,h (gdb_parse_exp_1): Added a wrapper for
gdb_parse_exp_1.
* varobj.h: Added USE_CURRENT_FRAME to varobj_type & changed def'n
of varobj_create.
* varobj.c (varobj_list): Return type indicates whether the
variable's type has changed (for current frame variables).
(varobj_update): Handle the case where the variable's type has
changed.
(delete_variable_1): Allow for deletion of variables that have not
been installed yet.
(new_root_variable): Initialize use_selected_frame variable.
(value_of_root): This is where most of the work to handle "current
frame" variables was added. Most of the complexity involves
handling the case where the type of the variable has changed.
(varobj_create): Add a "type" argument, to tell if the
variable is one of these "current frame" variables. Also protect
call to parse_exp_1 from long jumping.
* mi-var-block.exp: The error report from varobj_create changed
since I am now trapping parse_exp_1 errors. Change the tests to
match the new error message.
* mi-var-child.exp: Ditto.
* mi-var-cmd.exp: Ditto.
* lib/gdb.exp: Fix the gdbtk_start routine to correctly find all
the library directories.
* gdbtk-varobj.c (variable_create): Pass the correct
"how_specified" flag to the varobj_create routine.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-cmd.exp')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cmd.exp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index 7b4ebcc..f1fcedd 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -59,14 +59,14 @@ mi_gdb_test "111-var-create global_simple * global_simple" \ # Desc: Create non-existent variable mi_gdb_test "112-var-create bogus_unknown_variable * bogus_unknown_variable" \ - "&\"No symbol \\\\\"bogus_unknown_variable\\\\\" in current context.\\\\n\".*112\\^error,msg=\"No symbol \\\\\"bogus_unknown_variable\\\\\" in current context.\"" \ + "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*112\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ "create non-existent variable" # Test: c_variable-1.3 # Desc: Create out of scope variable mi_gdb_test "113-var-create argc * argc" \ - "&\"No symbol \\\\\"argc\\\\\" in current context.\\\\n\".*113\\^error,msg=\"No symbol \\\\\"argc\\\\\" in current context.\"" \ + "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ "create out of scope variable" mi_gdb_test "200-break-insert do_locals_tests" \ @@ -192,7 +192,7 @@ gdb_expect { # Test: c_variable-2.2 # Desc: check whether only linteger changed values mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"linteger\"\}" \ + "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: linteger changed" # Step over "lpinteger = &linteger;" @@ -209,7 +209,7 @@ gdb_expect { # Test: c_variable-2.3 # Desc: check whether only lpinteger changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lpinteger\"\}" \ + "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: lpinteger changed" # Step over "lcharacter = 'a';" @@ -226,7 +226,7 @@ gdb_expect { # Test: c_variable-2.4 # Desc: check whether only lcharacter changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lcharacter\"\}" \ + "\\^done,changelist=\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: lcharacter changed" # Step over "lpcharacter = &lcharacter;" @@ -243,7 +243,7 @@ gdb_expect { # Test: c_variable-2.5 # Desc: check whether only lpcharacter changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lpcharacter\"\}" \ + "\\^done,changelist=\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: lpcharacter changed" @@ -272,7 +272,7 @@ gdb_expect { # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, # lsimple.unsigned_character lsimple.integer lsimple.character changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lsimple.integer\",name=\"lsimple->integer\",name=\"lsimple.character\",name=\"lpdouble\",name=\"ldouble\",name=\"lpfloat\",name=\"lfloat\",name=\"lplong\",name=\"llong\"\}" \ + "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lplong\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: many changed" # Step over: @@ -294,7 +294,7 @@ gdb_expect { # Test: c_variable-2.7 # Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"func\",name=\"lpsimple\"\}" \ + "\\^done,changelist=\{name=\"func\",in_scope=\"true\",type_changed=\"false\",name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: func and lpsimple changed" # Step over @@ -323,7 +323,7 @@ gdb_expect { # Note: this test also checks that lpsimple->integer and lsimple.integer have # changed (they are the same) mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lsimple.integer\",name=\"lsimple->integer\",name=\"lsimple.character\",name=\"ldouble\",name=\"lfloat\",name=\"llong\",name=\"lcharacter\",name=\"linteger\"\}" \ + "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\",name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: func and lpsimple changed" @@ -454,7 +454,7 @@ mi_gdb_test "-var-create l * l" \ # Test: c_variable-2.11 # Desc: create do_locals_tests local in subroutine1 mi_gdb_test "-var-create linteger * linteger" \ - "&\"No symbol \\\\\"linteger\\\\\" in current context.\\\\n\".*\\^error,msg=\"No symbol \\\\\"linteger\\\\\" in current context.\"" \ + "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ "create linteger" send_gdb "-exec-step\n" @@ -471,10 +471,14 @@ gdb_expect { # Desc: change global_simple.integer # Note: This also tests whether we are reporting changes in structs properly. # gdb normally would say that global_simple has changed, but we -# special case that, since it is not what a human expects to see. +# special case that, since it is not what a human expects to +# see. + +setup_xfail *-*-* mi_gdb_test "-var-update *" \ "\\^done,changelist=\{FIXME: WHAT IS CORRECT HERE\}" \ "update all vars: changed FIXME" +clear_xfail *-*-* send_gdb "-exec-step\n" gdb_expect { @@ -487,7 +491,7 @@ gdb_expect { # Test: c_variable-2.13 # Desc: change subroutine1 local i mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"i\"\}" \ + "\\^done,changelist=\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: i changed" send_gdb "-exec-step\n" @@ -501,7 +505,7 @@ gdb_expect { # Test: c_variable-2.14 # Desc: change do_locals_tests local llong mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"llong\"\}" \ + "\\^done,changelist=\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: llong changed" send_gdb "-exec-next\n" @@ -515,8 +519,8 @@ gdb_expect { # Test: c_variable-2.15 # Desc: check for out of scope subroutine1 locals mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{\}" \ - "update all vars: none changed" + "\\^done,changelist=\{name=\"l\",in_scope=\"false\",name=\"i\",in_scope=\"false\"\}" \ + "update all vars: all now out of scope" # Done with locals/globals tests. Erase all variables #delete_all_variables |