From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] MI: Add value field to output of -var-create
Date: Thu, 18 Jan 2007 09:09:00 -0000 [thread overview]
Message-ID: <17839.14615.772612.987502@kahikatea.snap.net.nz> (raw)
In-Reply-To: <20070105150747.GD24554@nevyn.them.org>
[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 2092 bytes --]
> > This patch just adds the value field to the output of var-create so that
> > the frontend doesn't need to issue another command to find out what it
> > is.
> >
> > If approved, I'll change the tests and documentation accordingly.
>
> Seems fine to me, after we work out what to do with the testsuite. I
> went to check whether this should be PRINT_ALL_VALUES or
> PRINT_SIMPLE_VALUES but it seems fine the way you've got it - I wish
> I could remember the rational for PRINT_SIMPLE_VALUES properly.
OK, I've done this now with all tests changed. I've used Vladimir's
mi_create_varobj as much as possible. The three places where I've kept
-var-create are:
1) Where failure of -var-create is being tested.
2) Where a command token is used.
3) Where a name isn't specified for the variable object ("-" used).
I get the same test results before and after my change.
--
Nick http://www.inet.net.nz/~nickrob
2007-01-18 Nick Roberts <nickrob@snap.net.nz>
* mi/mi-cmd-var.c (mi_cmd_var_create): Add value field.
2007-01-18 Nick Roberts <nickrob@snap.net.nz>
* gdb.mi/mi-var-block.exp, gdb.mi/mi2-var-block.exp,
* gdb.mi/mi-var-child.exp, gdb.mi/mi2-var-child.exp,
* gdb.mi/mi-var-child-f.exp, gdb.mi/mi-var-cmd.exp,
* gdb.mi/mi2-var-cmd.exp, gdb.mi/mi-var-display.exp,
* gdb.mi/mi2-var-display.exp, lib/mi-support.exp:
Update tests for -var-create to include value field.
*** mi-cmd-var.c 10 Jan 2007 11:56:57 +1300 1.28
--- mi-cmd-var.c 18 Jan 2007 17:26:48 +1300
*************** mi_cmd_var_create (char *command, char *
*** 125,131 ****
if (var == NULL)
error (_("mi_cmd_var_create: unable to create variable object"));
! print_varobj (var, PRINT_NO_VALUES, 0 /* don't print expression */);
do_cleanups (old_cleanups);
return MI_CMD_DONE;
--- 125,131 ----
if (var == NULL)
error (_("mi_cmd_var_create: unable to create variable object"));
! print_varobj (var, PRINT_ALL_VALUES, 0 /* don't print expression */);
do_cleanups (old_cleanups);
return MI_CMD_DONE;
[-- Attachment #2: Update tests for -var-create to include value field. --]
[-- Type: application/octet-stream, Size: 47307 bytes --]
Index: gdb.mi/mi-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-block.exp,v
retrieving revision 1.13
diff -c -p -r1.13 mi-var-block.exp
*** gdb.mi/mi-var-block.exp 9 Jan 2007 17:59:13 -0000 1.13
--- gdb.mi/mi-var-block.exp 18 Jan 2007 08:48:57 -0000
*************** mi_runto do_block_tests
*** 44,52 ****
# Test: c_variable-3.2
# Desc: create cb and foo
! mi_gdb_test "-var-create cb * cb" \
! "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \
! "create local variable cb"
mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
--- 44,50 ----
# Test: c_variable-3.2
# Desc: create cb and foo
! mi_create_varobj cb cb "create local variable cb"
mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
*************** mi_gdb_test "-var-delete foo" \
*** 66,74 ****
# Test: c_variable-3.3
# Desc: create foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \
! "create local variable foo"
# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 64,70 ----
# Test: c_variable-3.3
# Desc: create foo
! mi_create_varobj foo foo "create local variable foo"
# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 88,96 ****
# Test: c_variable-3.5
# Desc: create inner block foo
! mi_gdb_test "-var-create inner_foo * foo" \
! "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \
! "create local variable inner_foo"
# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 84,90 ----
# Test: c_variable-3.5
# Desc: create inner block foo
! mi_create_varobj inner_foo foo "create local variable inner_foo"
# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 99,107 ****
# Test: c_variable-3.6
# Desc: create foo2
! mi_gdb_test "-var-create foo2 * foo2" \
! "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \
! "create local variable foo2"
# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
--- 93,99 ----
# Test: c_variable-3.6
# Desc: create foo2
! mi_create_varobj foo2 foo2 "create local variable foo2"
# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
Index: gdb.mi/mi2-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-block.exp,v
retrieving revision 1.5
diff -c -p -r1.5 mi2-var-block.exp
*** gdb.mi/mi2-var-block.exp 9 Jan 2007 17:59:13 -0000 1.5
--- gdb.mi/mi2-var-block.exp 18 Jan 2007 08:48:57 -0000
*************** mi_runto do_block_tests
*** 45,53 ****
# Test: c_variable-3.2
# Desc: create cb and foo
! mi_gdb_test "-var-create cb * cb" \
! "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \
! "create local variable cb"
mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
--- 45,51 ----
# Test: c_variable-3.2
# Desc: create cb and foo
! mi_create_varobj cb cb "create local variable cb"
mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
*************** mi_gdb_test "-var-delete foo" \
*** 67,75 ****
# Test: c_variable-3.3
# Desc: create foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \
! "create local variable foo"
# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 65,71 ----
# Test: c_variable-3.3
# Desc: create foo
! mi_create_varobj foo foo "create local variable foo"
# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 89,97 ****
# Test: c_variable-3.5
# Desc: create inner block foo
! mi_gdb_test "-var-create inner_foo * foo" \
! "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \
! "create local variable inner_foo"
# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 85,91 ----
# Test: c_variable-3.5
# Desc: create inner block foo
! mi_create_varobj inner_foo foo "create local variable inner_foo"
# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 100,108 ****
# Test: c_variable-3.6
# Desc: create foo2
! mi_gdb_test "-var-create foo2 * foo2" \
! "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \
! "create local variable foo2"
# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
--- 94,100 ----
# Test: c_variable-3.6
# Desc: create foo2
! mi_create_varobj foo2 foo2 "create local variable foo2"
# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
Index: gdb.mi/mi-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.exp,v
retrieving revision 1.21
diff -c -p -r1.21 mi-var-child.exp
*** gdb.mi/mi-var-child.exp 10 Aug 2006 05:27:21 -0000 1.21
--- gdb.mi/mi-var-child.exp 18 Jan 2007 08:49:01 -0000
*************** mi_execute_to "exec-next" "end-stepping-
*** 55,63 ****
# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_gdb_test "-var-create struct_declarations * struct_declarations" \
! "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \
! "create local variable struct_declarations"
# Test: c_variable-4.3
# Desc: children of struct_declarations
--- 55,62 ----
# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_create_varobj struct_declarations struct_declarations \
! "create local variable struct_declarations"
# Test: c_variable-4.3
# Desc: children of struct_declarations
*************** mi_step_to do_children_tests {} ".*${src
*** 563,571 ****
# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
! "create local variable weird"
# Test: c_variable-4.82
# Desc: children of weird
--- 562,568 ----
# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_create_varobj weird weird "create local variable weird"
# Test: c_variable-4.82
# Desc: children of weird
*************** mi_gdb_test "-var-info-num-children weir
*** 627,635 ****
# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
! "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \
! "create local variable weird->int_ptr_ptr"
# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
--- 624,631 ----
# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_create_varobj weird->int_ptr_ptr weird->int_ptr_ptr \
! "create local variable weird->int_ptr_ptr"
# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
*************** mi_execute_to "exec-step 43" "end-steppi
*** 893,901 ****
# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
! "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \
! "create local variable psnp->char_ptr"
# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
--- 889,896 ----
# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_create_varobj psnp->char_ptr psnp->char_ptr \
! "create local variable psnp->char_ptr"
# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 966,974 ****
# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
! "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \
! "create local variable psnp->long_ptr"
# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
--- 961,968 ----
# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_create_varobj psnp->long_ptr psnp->long_ptr \
! "create local variable psnp->long_ptr"
# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 1033,1041 ****
# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
! "\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
! "create local variable psnp->ptrs"
# Test: c_variable-5.31
# Desc: children of psnp->ptrs
--- 1027,1033 ----
# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_create_varobj psnp->ptrs psnp->ptrs "create local variable psnp->ptrs"
# Test: c_variable-5.31
# Desc: children of psnp->ptrs
*************** mi_step_to do_children_tests {} ".*${src
*** 1210,1216 ****
# Why does this have a FIXME?
setup_xfail *-*-*
mi_gdb_test "-var-update *" \
! "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
"update all vars psnp->next->long_ptr (and 1.long_ptr) changed"
clear_xfail *-*-*
--- 1202,1208 ----
# Why does this have a FIXME?
setup_xfail *-*-*
mi_gdb_test "-var-update *" \
! "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\pe_changed=\"false\"\}\\\]" \
"update all vars psnp->next->long_ptr (and 1.long_ptr) changed"
clear_xfail *-*-*
Index: gdb.mi/mi2-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-child.exp,v
retrieving revision 1.4
diff -c -p -r1.4 mi2-var-child.exp
*** gdb.mi/mi2-var-child.exp 10 Aug 2006 05:27:21 -0000 1.4
--- gdb.mi/mi2-var-child.exp 18 Jan 2007 08:49:04 -0000
*************** mi_runto do_children_tests
*** 51,59 ****
# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_gdb_test "-var-create struct_declarations * struct_declarations" \
! "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \
! "create local variable struct_declarations"
# Test: c_variable-4.3
# Desc: children of struct_declarations
--- 51,58 ----
# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_create_varobj struct_declarations struct_declarations \
! "create local variable struct_declarations"
# Test: c_variable-4.3
# Desc: children of struct_declarations
*************** mi_step_to do_children_tests {} {.*var-c
*** 559,567 ****
# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
! "create local variable weird"
# Test: c_variable-4.82
# Desc: children of weird
--- 558,564 ----
# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_create_varobj weird weird "create local variable weird"
# Test: c_variable-4.82
# Desc: children of weird
*************** mi_gdb_test "-var-info-num-children weir
*** 623,631 ****
# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
! "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \
! "create local variable weird->int_ptr_ptr"
# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
--- 620,627 ----
# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_create_varobj weird->int_ptr_ptr weird->int_ptr_ptr \
! "create local variable weird->int_ptr_ptr"
# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
*************** mi_execute_to "exec-step 43" "end-steppi
*** 865,873 ****
# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
! "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \
! "create local variable psnp->char_ptr"
# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
--- 861,868 ----
# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_create_varobj psnp->char_ptr psnp->char_ptr \
! "create local variable psnp->char_ptr"
# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 938,946 ****
# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
! "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \
! "create local variable psnp->long_ptr"
# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
--- 933,940 ----
# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_create_varobj psnp->long_ptr psnp->long_ptr \
! "create local variable psnp->long_ptr"
# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 1005,1013 ****
# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
! "\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
! "create local variable psnp->ptrs"
# Test: c_variable-5.31
# Desc: children of psnp->ptrs
--- 999,1006 ----
# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_create_varobj psnp->ptrs psnp->ptrs "create local variable psnp->ptrs"
!
# Test: c_variable-5.31
# Desc: children of psnp->ptrs
Index: gdb.mi/mi-var-child-f.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child-f.exp,v
retrieving revision 1.4
diff -c -p -r1.4 mi-var-child-f.exp
*** gdb.mi/mi-var-child-f.exp 12 Jan 2007 11:36:20 -0000 1.4
--- gdb.mi/mi-var-child-f.exp 18 Jan 2007 08:49:04 -0000
*************** mi_gdb_load ${binfile}
*** 38,46 ****
mi_runto MAIN__
! mi_gdb_test "-var-create array * array" \
! "\\^done,name=\"array\",numchild=\"3\",type=\"integer \\(2,-1:1\\)\"" \
! "create local variable array"
mi_gdb_test "-var-list-children --all-values array" \
"\\^done,numchild=\"3\",children=\\\[child=\{name=\"array.-1\",exp=\"-1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\},child=\{name=\"array.0\",exp=\"0\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\},child=\{name=\"array.1\",exp=\"1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\}\\\]" \
--- 38,44 ----
mi_runto MAIN__
! mi_create_varobj "array" "array" "create local variable array"
mi_gdb_test "-var-list-children --all-values array" \
"\\^done,numchild=\"3\",children=\\\[child=\{name=\"array.-1\",exp=\"-1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\},child=\{name=\"array.0\",exp=\"0\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\},child=\{name=\"array.1\",exp=\"1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\}\\\]" \
Index: gdb.mi/mi-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v
retrieving revision 1.24
diff -c -p -r1.24 mi-var-cmd.exp
*** gdb.mi/mi-var-cmd.exp 9 Jan 2007 17:59:13 -0000 1.24
--- gdb.mi/mi-var-cmd.exp 18 Jan 2007 08:49:06 -0000
*************** mi_gdb_load ${binfile}
*** 52,58 ****
# Desc: Create global variable
mi_gdb_test "111-var-create global_simple * global_simple" \
! "111\\^done,name=\"global_simple\",numchild=\"6\",type=\"simpleton\"" \
"create global variable"
# Test: c_variable-1.2
--- 52,58 ----
# Desc: Create global variable
mi_gdb_test "111-var-create global_simple * global_simple" \
! "111\\^done,name=\"global_simple\",numchild=\"6\",value=\".*\",type=\"simpleton\"" \
"create global variable"
# Test: c_variable-1.2
*************** mi_runto do_locals_tests
*** 74,149 ****
# Test: c_variable-1.4
# Desc: create local variables
! mi_gdb_test "-var-create linteger * linteger" \
! "\\^done,name=\"linteger\",numchild=\"0\",type=\"int\"" \
! "create local variable linteger"
! mi_gdb_test "-var-create lpinteger * lpinteger" \
! "\\^done,name=\"lpinteger\",numchild=\"1\",type=\"int \\*\"" \
! "create local variable lpinteger"
!
! mi_gdb_test "-var-create lcharacter * lcharacter" \
! "\\^done,name=\"lcharacter\",numchild=\"0\",type=\"char\"" \
! "create local variablelcharacter "
!
! mi_gdb_test "-var-create lpcharacter * lpcharacter" \
! "\\^done,name=\"lpcharacter\",numchild=\"1\",type=\"char \\*\"" \
! "create local variable lpcharacter"
!
! mi_gdb_test "-var-create llong * llong" \
! "\\^done,name=\"llong\",numchild=\"0\",type=\"long int\"" \
! "create local variable llong"
!
! mi_gdb_test "-var-create lplong * lplong" \
! "\\^done,name=\"lplong\",numchild=\"1\",type=\"long int \\*\"" \
! "create local variable lplong"
!
! mi_gdb_test "-var-create lfloat * lfloat" \
! "\\^done,name=\"lfloat\",numchild=\"0\",type=\"float\"" \
! "create local variable lfloat"
!
! mi_gdb_test "-var-create lpfloat * lpfloat" \
! "\\^done,name=\"lpfloat\",numchild=\"1\",type=\"float \\*\"" \
! "create local variable lpfloat"
!
! mi_gdb_test "-var-create ldouble * ldouble" \
! "\\^done,name=\"ldouble\",numchild=\"0\",type=\"double\"" \
! "create local variable ldouble"
!
! mi_gdb_test "-var-create lpdouble * lpdouble" \
! "\\^done,name=\"lpdouble\",numchild=\"1\",type=\"double \\*\"" \
! "create local variable lpdouble"
!
! mi_gdb_test "-var-create lsimple * lsimple" \
! "\\^done,name=\"lsimple\",numchild=\"6\",type=\"struct _simple_struct\"" \
! "create local variable lsimple"
!
! mi_gdb_test "-var-create lpsimple * lpsimple" \
! "\\^done,name=\"lpsimple\",numchild=\"6\",type=\"struct _simple_struct \\*\"" \
! "create local variable lpsimple"
!
! mi_gdb_test "-var-create func * func" \
! "\\^done,name=\"func\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
! "create local variable func"
# Test: c_variable-1.5
# Desc: create lsimple.character
! mi_gdb_test "-var-create lsimple.character * lsimple.character" \
! "\\^done,name=\"lsimple.character\",numchild=\"0\",type=\"char\"" \
! "create lsimple.character"
# Test: c_variable-1.6
# Desc: create lpsimple->integer
! mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \
! "\\^done,name=\"lsimple->integer\",numchild=\"0\",type=\"int\"" \
! "create lsimple->integer"
# Test: c_variable-1.7
# Desc: ceate lsimple.integer
! mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \
! "\\^done,name=\"lsimple.integer\",numchild=\"0\",type=\"int\"" \
! "create lsimple->integer"
!
# Test: c_variable-1.9
# Desc: create type name
--- 74,116 ----
# Test: c_variable-1.4
# Desc: create local variables
! mi_create_varobj linteger linteger "create local variable linteger"
!
! mi_create_varobj lpinteger lpinteger "create local variable lpinteger"
!
! mi_create_varobj lcharacter lcharacter "create local variable lcharacter"
!
! mi_create_varobj lpcharacter lpcharacter "create local variable lpcharacter"
!
! mi_create_varobj llong llong "create local variable llong"
!
! mi_create_varobj lplong lplong "create local variable lplong"
!
! mi_create_varobj lfloat lfloat "create local variable lfloat"
! mi_create_varobj lpfloat lpfloat "create local variable lpfloat"
!
! mi_create_varobj ldouble ldouble "create local variable ldouble"
!
! mi_create_varobj lpdouble lpdouble "create local variable lpdouble"
!
! mi_create_varobj lsimple lsimple "create local variable lsimple"
!
! mi_create_varobj lpsimple lpsimple "create local variable lpsimple"
!
! mi_create_varobj func func "create local variable func"
# Test: c_variable-1.5
# Desc: create lsimple.character
! mi_create_varobj lsimple.character lsimple.character "create lsimple.character"
# Test: c_variable-1.6
# Desc: create lpsimple->integer
! mi_create_varobj lsimple->integer lsimple->integer "create lsimple->integer"
# Test: c_variable-1.7
# Desc: ceate lsimple.integer
! mi_create_varobj lsimple.integer lsimple.integer "create lsimple->integer"
# Test: c_variable-1.9
# Desc: create type name
*************** mi_gdb_test "-var-update *" \
*** 403,411 ****
"\\^done,changelist=\\\[\\\]" \
"assign same value to func (update)"
! mi_gdb_test "-var-create array_ptr * array_ptr" \
! "\\^done,name=\"array_ptr\",numchild=\"1\",type=\"int \\*\"" \
! "create global variable array_ptr"
mi_gdb_test "-var-assign array_ptr array2" \
"\\^done,value=\"$hex\"" \
--- 370,376 ----
"\\^done,changelist=\\\[\\\]" \
"assign same value to func (update)"
! mi_create_varobj array_ptr array_ptr "create global variable array_ptr"
mi_gdb_test "-var-assign array_ptr array2" \
"\\^done,value=\"$hex\"" \
*************** mi_continue_to subroutine1
*** 434,446 ****
# Test: c_variable-2.10
# Desc: create variable for locals i,l in subroutine1
! mi_gdb_test "-var-create i * i" \
! "\\^done,name=\"i\",numchild=\"0\",type=\"int\"" \
! "create i"
!
! mi_gdb_test "-var-create l * l" \
! "\\^done,name=\"l\",numchild=\"1\",type=\"long int \\*\"" \
! "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
--- 399,407 ----
# Test: c_variable-2.10
# Desc: create variable for locals i,l in subroutine1
! mi_create_varobj i i "create i"
!
! mi_create_varobj l l "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
*************** mi_gdb_test "-var-delete l" \
*** 575,581 ****
mi_continue_to do_special_tests
mi_gdb_test "-var-create selected_a @ a" \
! {\^done,name="selected_a",numchild="0",type="int"} \
"create selected_a"
mi_continue_to incr_a
--- 536,542 ----
mi_continue_to do_special_tests
mi_gdb_test "-var-create selected_a @ a" \
! {\^done,name="selected_a",numchild="0",value=\".*\",type="int"} \
"create selected_a"
mi_continue_to incr_a
*************** mi_gdb_test "-var-update selected_a" \
*** 595,603 ****
# A varobj we fail to read during -var-update should be considered
# out of scope.
! mi_gdb_test "-var-create null_ptr * **0" \
! {\^done,name="null_ptr",numchild="0",type="int"} \
! "create null_ptr"
# Allow this to succeed, if address zero is readable, although it
# will not test what it was meant to. Most important is that GDB
--- 556,562 ----
# A varobj we fail to read during -var-update should be considered
# out of scope.
! mi_create_varobj null_ptr **0 "create null_ptr"
# Allow this to succeed, if address zero is readable, although it
# will not test what it was meant to. Most important is that GDB
*************** mi_gdb_test "kill" \
*** 620,628 ****
{&"kill\\n".*\^done} \
"kill program before endvar"
! mi_gdb_test "-var-create endvar * _end" \
! {(\^done,name="endvar",numchild="0",type=".*"|&".*unable to.*".*\^error,msg=".*")} \
! "create endvar"
# Allow this to succeed whether the value is readable, unreadable, or
# missing. Most important is that GDB does not crash.
--- 579,585 ----
{&"kill\\n".*\^done} \
"kill program before endvar"
! mi_create_varobj endvar _end "create endvar"
# Allow this to succeed whether the value is readable, unreadable, or
# missing. Most important is that GDB does not crash.
Index: gdb.mi/mi2-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-cmd.exp,v
retrieving revision 1.8
diff -c -p -r1.8 mi2-var-cmd.exp
*** gdb.mi/mi2-var-cmd.exp 9 Jan 2007 17:59:13 -0000 1.8
--- gdb.mi/mi2-var-cmd.exp 18 Jan 2007 08:49:07 -0000
*************** mi_gdb_load ${binfile}
*** 52,58 ****
# Desc: Create global variable
mi_gdb_test "111-var-create global_simple * global_simple" \
! "111\\^done,name=\"global_simple\",numchild=\"6\",type=\"simpleton\"" \
"create global variable"
# Test: c_variable-1.2
--- 52,58 ----
# Desc: Create global variable
mi_gdb_test "111-var-create global_simple * global_simple" \
! "111\\^done,name=\"global_simple\",numchild=\"6\",value=\".*\",type=\"simpleton\"" \
"create global variable"
# Test: c_variable-1.2
*************** mi_runto do_locals_tests
*** 74,149 ****
# Test: c_variable-1.4
# Desc: create local variables
! mi_gdb_test "-var-create linteger * linteger" \
! "\\^done,name=\"linteger\",numchild=\"0\",type=\"int\"" \
! "create local variable linteger"
! mi_gdb_test "-var-create lpinteger * lpinteger" \
! "\\^done,name=\"lpinteger\",numchild=\"1\",type=\"int \\*\"" \
! "create local variable lpinteger"
!
! mi_gdb_test "-var-create lcharacter * lcharacter" \
! "\\^done,name=\"lcharacter\",numchild=\"0\",type=\"char\"" \
! "create local variablelcharacter "
!
! mi_gdb_test "-var-create lpcharacter * lpcharacter" \
! "\\^done,name=\"lpcharacter\",numchild=\"1\",type=\"char \\*\"" \
! "create local variable lpcharacter"
!
! mi_gdb_test "-var-create llong * llong" \
! "\\^done,name=\"llong\",numchild=\"0\",type=\"long int\"" \
! "create local variable llong"
!
! mi_gdb_test "-var-create lplong * lplong" \
! "\\^done,name=\"lplong\",numchild=\"1\",type=\"long int \\*\"" \
! "create local variable lplong"
!
! mi_gdb_test "-var-create lfloat * lfloat" \
! "\\^done,name=\"lfloat\",numchild=\"0\",type=\"float\"" \
! "create local variable lfloat"
!
! mi_gdb_test "-var-create lpfloat * lpfloat" \
! "\\^done,name=\"lpfloat\",numchild=\"1\",type=\"float \\*\"" \
! "create local variable lpfloat"
!
! mi_gdb_test "-var-create ldouble * ldouble" \
! "\\^done,name=\"ldouble\",numchild=\"0\",type=\"double\"" \
! "create local variable ldouble"
!
! mi_gdb_test "-var-create lpdouble * lpdouble" \
! "\\^done,name=\"lpdouble\",numchild=\"1\",type=\"double \\*\"" \
! "create local variable lpdouble"
!
! mi_gdb_test "-var-create lsimple * lsimple" \
! "\\^done,name=\"lsimple\",numchild=\"6\",type=\"struct _simple_struct\"" \
! "create local variable lsimple"
!
! mi_gdb_test "-var-create lpsimple * lpsimple" \
! "\\^done,name=\"lpsimple\",numchild=\"6\",type=\"struct _simple_struct \\*\"" \
! "create local variable lpsimple"
!
! mi_gdb_test "-var-create func * func" \
! "\\^done,name=\"func\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
! "create local variable func"
# Test: c_variable-1.5
# Desc: create lsimple.character
! mi_gdb_test "-var-create lsimple.character * lsimple.character" \
! "\\^done,name=\"lsimple.character\",numchild=\"0\",type=\"char\"" \
! "create lsimple.character"
# Test: c_variable-1.6
# Desc: create lpsimple->integer
! mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \
! "\\^done,name=\"lsimple->integer\",numchild=\"0\",type=\"int\"" \
! "create lsimple->integer"
# Test: c_variable-1.7
# Desc: ceate lsimple.integer
! mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \
! "\\^done,name=\"lsimple.integer\",numchild=\"0\",type=\"int\"" \
! "create lsimple->integer"
!
# Test: c_variable-1.9
# Desc: create type name
--- 74,116 ----
# Test: c_variable-1.4
# Desc: create local variables
! mi_create_varobj linteger linteger "create local variable linteger"
!
! mi_create_varobj lpinteger lpinteger "create local variable lpinteger"
!
! mi_create_varobj lcharacter lcharacter "create local variable lcharacter"
!
! mi_create_varobj lpcharacter lpcharacter "create local variable lpcharacter"
!
! mi_create_varobj llong llong "create local variable llong"
!
! mi_create_varobj lplong lplong "create local variable lplong"
!
! mi_create_varobj lfloat lfloat "create local variable lfloat"
! mi_create_varobj lpfloat lpfloat "create local variable lpfloat"
!
! mi_create_varobj ldouble ldouble "create local variable ldouble"
!
! mi_create_varobj lpdouble lpdouble "create local variable lpdouble"
!
! mi_create_varobj lsimple lsimple "create local variable lsimple"
!
! mi_create_varobj lpsimple lpsimple "create local variable lpsimple"
!
! mi_create_varobj func func "create local variable func"
# Test: c_variable-1.5
# Desc: create lsimple.character
! mi_create_varobj lsimple.character lsimple.character "create lsimple.character"
# Test: c_variable-1.6
# Desc: create lpsimple->integer
! mi_create_varobj lsimple->integer lsimple->integer "create lsimple->integer"
# Test: c_variable-1.7
# Desc: ceate lsimple.integer
! mi_create_varobj lsimple.integer lsimple.integer "create lsimple->integer"
# Test: c_variable-1.9
# Desc: create type name
*************** mi_continue_to "subroutine1"
*** 397,409 ****
# Test: c_variable-2.10
# Desc: create variable for locals i,l in subroutine1
! mi_gdb_test "-var-create i * i" \
! "\\^done,name=\"i\",numchild=\"0\",type=\"int\"" \
! "create i"
!
! mi_gdb_test "-var-create l * l" \
! "\\^done,name=\"l\",numchild=\"1\",type=\"long int \\*\"" \
! "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
--- 364,372 ----
# Test: c_variable-2.10
# Desc: create variable for locals i,l in subroutine1
! mi_create_varobj i i "create i"
!
! mi_create_varobj l l "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
*************** mi_gdb_test "-var-delete l" \
*** 538,544 ****
mi_continue_to do_special_tests
mi_gdb_test "-var-create selected_a @ a" \
! {\^done,name="selected_a",numchild="0",type="int"} \
"create selected_a"
mi_continue_to incr_a
--- 501,507 ----
mi_continue_to do_special_tests
mi_gdb_test "-var-create selected_a @ a" \
! {\^done,name="selected_a",numchild="0",value=\".*\",type="int"} \
"create selected_a"
mi_continue_to incr_a
Index: gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.16
diff -c -p -r1.16 mi-var-display.exp
*** gdb.mi/mi-var-display.exp 9 Jan 2007 17:59:13 -0000 1.16
--- gdb.mi/mi-var-display.exp 18 Jan 2007 08:49:08 -0000
*************** gdb_expect {
*** 65,73 ****
# Test: c_variable-6.1
# Desc: create variable bar
! mi_gdb_test "-var-create bar * bar" \
! "\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
! "create local variable bar"
# Test: c_variable-6.2
# Desc: type of variable bar
--- 65,71 ----
# Test: c_variable-6.1
# Desc: create variable bar
! mi_create_varobj bar bar "create local variable bar"
# Test: c_variable-6.2
# Desc: type of variable bar
*************** mi_gdb_test "-var-delete bar" \
*** 119,127 ****
# Test: c_variable-6.11
# Desc: create variable foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
! "create local variable foo"
# Test: c_variable-6.12
# Desc: type of variable foo
--- 117,123 ----
# Test: c_variable-6.11
# Desc: create variable foo
! mi_create_varobj foo foo "create local variable foo"
# Test: c_variable-6.12
# Desc: type of variable foo
*************** mi_gdb_test "-var-delete foo" \
*** 179,187 ****
# Test: c_variable-6.21
# Desc: create variable weird and children
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
! "create local variable weird"
mi_gdb_test "-var-list-children weird" \
"\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
--- 175,181 ----
# Test: c_variable-6.21
# Desc: create variable weird and children
! mi_create_varobj weird weird "create local variable weird"
mi_gdb_test "-var-list-children weird" \
"\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
*************** gdb_expect {
*** 344,352 ****
# Test: c_variable-7.10
# Desc: create union u
! mi_gdb_test "-var-create u * u" \
! "\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
! "create local variable u"
# Test: c_variable-7.11
# Desc: value of u
--- 338,344 ----
# Test: c_variable-7.10
# Desc: create union u
! mi_create_varobj u u "create local variable u"
# Test: c_variable-7.11
# Desc: value of u
*************** mi_gdb_test "-var-list-children u" \
*** 380,388 ****
# Test: c_variable-7.20
# Desc: create anonu
! mi_gdb_test "-var-create anonu * anonu" \
! "\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
! "create local variable anonu"
# Test: c_variable-7.21
# Desc: value of anonu
--- 372,378 ----
# Test: c_variable-7.20
# Desc: create anonu
! mi_create_varobj anonu anonu "create local variable anonu"
# Test: c_variable-7.21
# Desc: value of anonu
*************** mi_gdb_test "-var-list-children anonu" \
*** 416,425 ****
# Test: c_variable-7.30
# Desc: create struct s
! mi_gdb_test "-var-create s * s" \
! "\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
! "create local variable s"
!
# Test: c_variable-7.31
# Desc: value of s
--- 406,412 ----
# Test: c_variable-7.30
# Desc: create struct s
! mi_create_varobj s s "create local variable s"
# Test: c_variable-7.31
# Desc: value of s
*************** mi_gdb_test "-var-list-children s" \
*** 454,462 ****
# Test: c_variable-7.40
# Desc: create anons
! mi_gdb_test "-var-create anons * anons" \
! "\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
! "create local variable anons"
# Test: c_variable-7.41
# Desc: value of anons
--- 441,447 ----
# Test: c_variable-7.40
# Desc: create anons
! mi_create_varobj anons anons "create local variable anons"
# Test: c_variable-7.41
# Desc: value of anons
*************** mi_gdb_test "-var-list-children anons" \
*** 491,499 ****
# Test: c_variable-7.50
# Desc: create enum e
! mi_gdb_test "-var-create e * e" \
! "\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
! "create local variable e"
setup_xfail "*-*-*"
# Test: c_variable-7.51
--- 476,482 ----
# Test: c_variable-7.50
# Desc: create enum e
! mi_create_varobj e e "create local variable e"
setup_xfail "*-*-*"
# Test: c_variable-7.51
*************** mi_gdb_test "-var-list-children e" \
*** 529,537 ****
# Test: c_variable-7.60
# Desc: create anone
! mi_gdb_test "-var-create anone * anone" \
! "\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
! "create local variable anone"
setup_xfail "*-*-*"
# Test: c_variable-7.61
--- 512,518 ----
# Test: c_variable-7.60
# Desc: create anone
! mi_create_varobj anone anone "create local variable anone"
setup_xfail "*-*-*"
# Test: c_variable-7.61
*************** gdb_expect {
*** 610,621 ****
# Test: c_variable-7.81
# Desc: Create variables in different scopes
! mi_gdb_test "-var-create a1 * a" \
! "\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
! "create local variable a1"
mi_gdb_test "-var-create a2 $fp a" \
! "\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
"create variable a2 in different scope"
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
--- 591,600 ----
# Test: c_variable-7.81
# Desc: Create variables in different scopes
! mi_create_varobj a1 a "create local variable a1"
mi_gdb_test "-var-create a2 $fp a" \
! "\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\"" \
"create variable a2 in different scope"
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
Index: gdb.mi/mi2-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v
retrieving revision 1.8
diff -c -p -r1.8 mi2-var-display.exp
*** gdb.mi/mi2-var-display.exp 9 Jan 2007 17:59:13 -0000 1.8
--- gdb.mi/mi2-var-display.exp 18 Jan 2007 08:49:09 -0000
*************** gdb_expect {
*** 65,73 ****
# Test: c_variable-6.1
# Desc: create variable bar
! mi_gdb_test "-var-create bar * bar" \
! "\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
! "create local variable bar"
# Test: c_variable-6.2
# Desc: type of variable bar
--- 65,71 ----
# Test: c_variable-6.1
# Desc: create variable bar
! mi_create_varobj bar bar "create local variable bar"
# Test: c_variable-6.2
# Desc: type of variable bar
*************** mi_gdb_test "-var-delete bar" \
*** 119,127 ****
# Test: c_variable-6.11
# Desc: create variable foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
! "create local variable foo"
# Test: c_variable-6.12
# Desc: type of variable foo
--- 117,123 ----
# Test: c_variable-6.11
# Desc: create variable foo
! mi_create_varobj foo foo "create local variable foo"
# Test: c_variable-6.12
# Desc: type of variable foo
*************** mi_gdb_test "-var-delete foo" \
*** 179,187 ****
# Test: c_variable-6.21
# Desc: create variable weird and children
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
! "create local variable weird"
mi_gdb_test "-var-list-children weird" \
"\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
--- 175,181 ----
# Test: c_variable-6.21
# Desc: create variable weird and children
! mi_create_varobj weird weird "create local variable weird"
mi_gdb_test "-var-list-children weird" \
"\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
*************** gdb_expect {
*** 344,352 ****
# Test: c_variable-7.10
# Desc: create union u
! mi_gdb_test "-var-create u * u" \
! "\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
! "create local variable u"
# Test: c_variable-7.11
# Desc: value of u
--- 338,344 ----
# Test: c_variable-7.10
# Desc: create union u
! mi_create_varobj u u "create local variable u"
# Test: c_variable-7.11
# Desc: value of u
*************** mi_gdb_test "-var-list-children u" \
*** 380,388 ****
# Test: c_variable-7.20
# Desc: create anonu
! mi_gdb_test "-var-create anonu * anonu" \
! "\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
! "create local variable anonu"
# Test: c_variable-7.21
# Desc: value of anonu
--- 372,378 ----
# Test: c_variable-7.20
# Desc: create anonu
! mi_create_varobj anonu anonu "create local variable anonu"
# Test: c_variable-7.21
# Desc: value of anonu
*************** mi_gdb_test "-var-list-children anonu" \
*** 416,425 ****
# Test: c_variable-7.30
# Desc: create struct s
! mi_gdb_test "-var-create s * s" \
! "\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
! "create local variable s"
!
# Test: c_variable-7.31
# Desc: value of s
--- 406,412 ----
# Test: c_variable-7.30
# Desc: create struct s
! mi_create_varobj s s "create local variable s"
# Test: c_variable-7.31
# Desc: value of s
*************** mi_gdb_test "-var-list-children s" \
*** 454,462 ****
# Test: c_variable-7.40
# Desc: create anons
! mi_gdb_test "-var-create anons * anons" \
! "\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
! "create local variable anons"
# Test: c_variable-7.41
# Desc: value of anons
--- 441,447 ----
# Test: c_variable-7.40
# Desc: create anons
! mi_create_varobj anons anons "create local variable anons"
# Test: c_variable-7.41
# Desc: value of anons
*************** mi_gdb_test "-var-list-children anons" \
*** 491,499 ****
# Test: c_variable-7.50
# Desc: create enum e
! mi_gdb_test "-var-create e * e" \
! "\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
! "create local variable e"
setup_xfail "*-*-*"
# Test: c_variable-7.51
--- 476,482 ----
# Test: c_variable-7.50
# Desc: create enum e
! mi_create_varobj e e "create local variable e"
setup_xfail "*-*-*"
# Test: c_variable-7.51
*************** mi_gdb_test "-var-list-children e" \
*** 529,537 ****
# Test: c_variable-7.60
# Desc: create anone
! mi_gdb_test "-var-create anone * anone" \
! "\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
! "create local variable anone"
setup_xfail "*-*-*"
# Test: c_variable-7.61
--- 512,518 ----
# Test: c_variable-7.60
# Desc: create anone
! mi_create_varobj anone anone "create local variable anone"
setup_xfail "*-*-*"
# Test: c_variable-7.61
*************** gdb_expect {
*** 610,621 ****
# Test: c_variable-7.81
# Desc: Create variables in different scopes
! mi_gdb_test "-var-create a1 * a" \
! "\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
! "create local variable a1"
mi_gdb_test "-var-create a2 $fp a" \
! "\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
"create variable a2 in different scope"
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
--- 591,600 ----
# Test: c_variable-7.81
# Desc: Create variables in different scopes
! mi_create_varobj a1 a "create local variable a1"
mi_gdb_test "-var-create a2 $fp a" \
! "\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\"" \
"create variable a2 in different scope"
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
Index: lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.39
diff -c -p -r1.39 mi-support.exp
*** lib/mi-support.exp 9 Jan 2007 17:59:14 -0000 1.39
--- lib/mi-support.exp 18 Jan 2007 08:49:12 -0000
*************** proc mi0_continue_to { bkptno func args
*** 1019,1025 ****
# Name cannot be "-".
proc mi_create_varobj { name expression testname } {
mi_gdb_test "-var-create $name * $expression" \
! "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",type=.*" \
$testname
}
--- 1019,1025 ----
# Name cannot be "-".
proc mi_create_varobj { name expression testname } {
mi_gdb_test "-var-create $name * $expression" \
! "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*" \
$testname
}
next prev parent reply other threads:[~2007-01-18 9:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-02 10:07 Nick Roberts
2007-01-04 20:20 ` Vladimir Prus
2007-01-04 23:22 ` Nick Roberts
2007-01-04 23:24 ` Daniel Jacobowitz
2007-01-05 7:40 ` Vladimir Prus
2007-01-05 15:07 ` Daniel Jacobowitz
2007-01-05 21:30 ` Nick Roberts
2007-01-07 23:32 ` Daniel Jacobowitz
2007-01-18 9:09 ` Nick Roberts [this message]
2007-01-20 19:09 ` Daniel Jacobowitz
2007-01-20 21:53 ` Nick Roberts
2007-02-03 4:54 ` Nick Roberts
2007-02-04 14:10 ` Daniel Jacobowitz
2007-02-04 21:42 ` Nick Roberts
2007-02-08 17:58 ` Daniel Jacobowitz
2007-02-08 20:07 ` Nick Roberts
2007-02-08 20:25 ` Daniel Jacobowitz
2007-02-08 20:27 ` Daniel Jacobowitz
2007-02-08 20:37 ` Nick Roberts
2007-02-08 20:37 ` Daniel Jacobowitz
2007-02-08 20:44 ` Nick Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17839.14615.772612.987502@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox