# Copyright (C) 1999 2000 Cygnus Solutions
|
# Copyright (C) 1999 2000 Cygnus Solutions
|
#
|
#
|
# This Program Is Free software; you can redistribute it and/or modify
|
# This Program Is Free software; you can redistribute it and/or modify
|
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
# (at your option) any later version.
|
# (at your option) any later version.
|
#
|
#
|
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
#
|
#
|
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
# Please email any bugs, comments, and/or additions to this file to:
|
# bug-gdb@prep.ai.mit.edu
|
# bug-gdb@prep.ai.mit.edu
|
|
|
# Test essential Machine interface (MI) operations
|
# Test essential Machine interface (MI) operations
|
#
|
#
|
# Verify that, using the MI, we can create, update, delete variables.
|
# Verify that, using the MI, we can create, update, delete variables.
|
#
|
#
|
|
|
|
|
load_lib mi-support.exp
|
load_lib mi-support.exp
|
|
|
gdb_exit
|
gdb_exit
|
if [mi_gdb_start] {
|
if [mi_gdb_start] {
|
continue
|
continue
|
}
|
}
|
|
|
set testfile "var-cmd"
|
set testfile "var-cmd"
|
set srcfile ${testfile}.c
|
set srcfile ${testfile}.c
|
set binfile ${objdir}/${subdir}/${testfile}
|
set binfile ${objdir}/${subdir}/${testfile}
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
}
|
}
|
|
|
mi_delete_breakpoints
|
mi_delete_breakpoints
|
mi_gdb_reinitialize_dir $srcdir/$subdir
|
mi_gdb_reinitialize_dir $srcdir/$subdir
|
mi_gdb_load ${binfile}
|
mi_gdb_load ${binfile}
|
|
|
mi_gdb_test "200-break-insert 260" \
|
mi_gdb_test "200-break-insert 260" \
|
"200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \
|
"200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \
|
"break-insert operation"
|
"break-insert operation"
|
|
|
mi_run_cmd
|
mi_run_cmd
|
# The running part has been checked already by mi_run_cmd
|
# The running part has been checked already by mi_run_cmd
|
gdb_expect {
|
gdb_expect {
|
-re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
|
-re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
|
pass "run to do_children_tests"
|
pass "run to do_children_tests"
|
}
|
}
|
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
|
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
|
timeout {fail "run to do_children_tests (timeout 2)"}
|
timeout {fail "run to do_children_tests (timeout 2)"}
|
}
|
}
|
|
|
##### #####
|
##### #####
|
# #
|
# #
|
# Display tests #
|
# Display tests #
|
# #
|
# #
|
##### #####
|
##### #####
|
|
|
# Test: c_variable-6.1
|
# Test: c_variable-6.1
|
# Desc: create variable bar
|
# Desc: create variable bar
|
mi_gdb_test "-var-create bar * bar" \
|
mi_gdb_test "-var-create bar * bar" \
|
"\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
|
"\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
|
"create local variable bar"
|
"create local variable bar"
|
|
|
# Test: c_variable-6.2
|
# Test: c_variable-6.2
|
# Desc: type of variable bar
|
# Desc: type of variable bar
|
mi_gdb_test "-var-info-type bar" \
|
mi_gdb_test "-var-info-type bar" \
|
"\\^done,type=\"int\"" \
|
"\\^done,type=\"int\"" \
|
"info type variable bar"
|
"info type variable bar"
|
|
|
# Test: c_variable-6.3
|
# Test: c_variable-6.3
|
# Desc: format of variable bar
|
# Desc: format of variable bar
|
mi_gdb_test "-var-show-format bar" \
|
mi_gdb_test "-var-show-format bar" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"show format variable bar"
|
"show format variable bar"
|
|
|
# Test: c_variable-6.4
|
# Test: c_variable-6.4
|
# Desc: value of variable bar
|
# Desc: value of variable bar
|
mi_gdb_test "-var-evaluate-expression bar" \
|
mi_gdb_test "-var-evaluate-expression bar" \
|
"\\^done,value=\"2121\"" \
|
"\\^done,value=\"2121\"" \
|
"eval variable bar"
|
"eval variable bar"
|
|
|
# Test: c_variable-6.5
|
# Test: c_variable-6.5
|
# Desc: change format of bar to hex
|
# Desc: change format of bar to hex
|
mi_gdb_test "-var-set-format bar hexadecimal" \
|
mi_gdb_test "-var-set-format bar hexadecimal" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"set format variable bar"
|
"set format variable bar"
|
|
|
# Test: c_variable-6.6
|
# Test: c_variable-6.6
|
# Desc: value of bar with new format
|
# Desc: value of bar with new format
|
mi_gdb_test "-var-evaluate-expression bar" \
|
mi_gdb_test "-var-evaluate-expression bar" \
|
"\\^done,value=\"0x849\"" \
|
"\\^done,value=\"0x849\"" \
|
"eval variable bar with new format"
|
"eval variable bar with new format"
|
|
|
# Test: c_variable-6.7
|
# Test: c_variable-6.7
|
# Desc: change value of bar
|
# Desc: change value of bar
|
mi_gdb_test "-var-assign bar 3" \
|
mi_gdb_test "-var-assign bar 3" \
|
"\\^done,value=\"0x3\"" \
|
"\\^done,value=\"0x3\"" \
|
"assing to variable bar"
|
"assing to variable bar"
|
|
|
mi_gdb_test "-var-set-format bar decimal" \
|
mi_gdb_test "-var-set-format bar decimal" \
|
"\\^done,format=\"decimal\"" \
|
"\\^done,format=\"decimal\"" \
|
"set format variable bar"
|
"set format variable bar"
|
|
|
mi_gdb_test "-var-evaluate-expression bar" \
|
mi_gdb_test "-var-evaluate-expression bar" \
|
"\\^done,value=\"3\"" \
|
"\\^done,value=\"3\"" \
|
"eval variable bar with new value"
|
"eval variable bar with new value"
|
|
|
mi_gdb_test "-var-delete bar" \
|
mi_gdb_test "-var-delete bar" \
|
"\\^done,ndeleted=\"1\"" \
|
"\\^done,ndeleted=\"1\"" \
|
"delete var bar"
|
"delete var bar"
|
|
|
# Test: c_variable-6.11
|
# Test: c_variable-6.11
|
# Desc: create variable foo
|
# Desc: create variable foo
|
mi_gdb_test "-var-create foo * foo" \
|
mi_gdb_test "-var-create foo * foo" \
|
"\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
|
"\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
|
"create local variable foo"
|
"create local variable foo"
|
|
|
# Test: c_variable-6.12
|
# Test: c_variable-6.12
|
# Desc: type of variable foo
|
# Desc: type of variable foo
|
mi_gdb_test "-var-info-type foo" \
|
mi_gdb_test "-var-info-type foo" \
|
"\\^done,type=\"int \\*\"" \
|
"\\^done,type=\"int \\*\"" \
|
"info type variable foo"
|
"info type variable foo"
|
|
|
# Test: c_variable-6.13
|
# Test: c_variable-6.13
|
# Desc: format of variable foo
|
# Desc: format of variable foo
|
mi_gdb_test "-var-show-format foo" \
|
mi_gdb_test "-var-show-format foo" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"show format variable foo"
|
"show format variable foo"
|
|
|
# Test: c_variable-6.14
|
# Test: c_variable-6.14
|
# Desc: value of variable foo
|
# Desc: value of variable foo
|
mi_gdb_test "-var-evaluate-expression foo" \
|
mi_gdb_test "-var-evaluate-expression foo" \
|
"\\^done,value=\"$hex\"" \
|
"\\^done,value=\"$hex\"" \
|
"eval variable foo"
|
"eval variable foo"
|
|
|
# Test: c_variable-6.15
|
# Test: c_variable-6.15
|
# Desc: change format of var to octal
|
# Desc: change format of var to octal
|
mi_gdb_test "-var-set-format foo octal" \
|
mi_gdb_test "-var-set-format foo octal" \
|
"\\^done,format=\"octal\"" \
|
"\\^done,format=\"octal\"" \
|
"set format variable foo"
|
"set format variable foo"
|
|
|
mi_gdb_test "-var-show-format foo" \
|
mi_gdb_test "-var-show-format foo" \
|
"\\^done,format=\"octal\"" \
|
"\\^done,format=\"octal\"" \
|
"show format variable foo"
|
"show format variable foo"
|
|
|
# Test: c_variable-6.16
|
# Test: c_variable-6.16
|
# Desc: value of foo with new format
|
# Desc: value of foo with new format
|
mi_gdb_test "-var-evaluate-expression foo" \
|
mi_gdb_test "-var-evaluate-expression foo" \
|
"\\^done,value=\"\[0-7\]+\"" \
|
"\\^done,value=\"\[0-7\]+\"" \
|
"eval variable foo"
|
"eval variable foo"
|
|
|
# Test: c_variable-6.17
|
# Test: c_variable-6.17
|
# Desc: change value of foo
|
# Desc: change value of foo
|
mi_gdb_test "-var-assign foo 3" \
|
mi_gdb_test "-var-assign foo 3" \
|
"\\^done,value=\"03\"" \
|
"\\^done,value=\"03\"" \
|
"assing to variable foo"
|
"assing to variable foo"
|
|
|
mi_gdb_test "-var-set-format foo decimal" \
|
mi_gdb_test "-var-set-format foo decimal" \
|
"\\^done,format=\"decimal\"" \
|
"\\^done,format=\"decimal\"" \
|
"set format variable foo"
|
"set format variable foo"
|
|
|
# Test: c_variable-6.18
|
# Test: c_variable-6.18
|
# Desc: check new value of foo
|
# Desc: check new value of foo
|
mi_gdb_test "-var-evaluate-expression foo" \
|
mi_gdb_test "-var-evaluate-expression foo" \
|
"\\^done,value=\"3\"" \
|
"\\^done,value=\"3\"" \
|
"eval variable foo"
|
"eval variable foo"
|
|
|
mi_gdb_test "-var-delete foo" \
|
mi_gdb_test "-var-delete foo" \
|
"\\^done,ndeleted=\"1\"" \
|
"\\^done,ndeleted=\"1\"" \
|
"delete var foo"
|
"delete var foo"
|
|
|
# Test: c_variable-6.21
|
# Test: c_variable-6.21
|
# Desc: create variable weird and children
|
# Desc: create variable weird and children
|
mi_gdb_test "-var-create weird * weird" \
|
mi_gdb_test "-var-create weird * weird" \
|
"\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
|
"\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
|
"create local variable weird"
|
"create local variable weird"
|
|
|
mi_gdb_test "-var-list-children 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=\"0\",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 \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
|
"\\^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=\"0\",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 \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
|
"get children local variable weird"
|
"get children local variable weird"
|
|
|
|
|
# Test: c_variable-6.23
|
# Test: c_variable-6.23
|
# Desc: change format of weird.func_ptr and weird.func_ptr_ptr
|
# Desc: change format of weird.func_ptr and weird.func_ptr_ptr
|
mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
|
mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"set format variable weird.func_ptr"
|
"set format variable weird.func_ptr"
|
|
|
mi_gdb_test "-var-show-format weird.func_ptr" \
|
mi_gdb_test "-var-show-format weird.func_ptr" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"show format variable weird.func_ptr"
|
"show format variable weird.func_ptr"
|
|
|
mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
|
mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"set format variable weird.func_ptr_ptr"
|
"set format variable weird.func_ptr_ptr"
|
|
|
mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
|
mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"show format variable weird.func_ptr_ptr"
|
"show format variable weird.func_ptr_ptr"
|
|
|
# Test: c_variable-6.24
|
# Test: c_variable-6.24
|
# Desc: format of weird and children
|
# Desc: format of weird and children
|
mi_gdb_test "-var-set-format weird natural" \
|
mi_gdb_test "-var-set-format weird natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird"
|
"set format variable weird"
|
|
|
mi_gdb_test "-var-set-format weird.integer natural" \
|
mi_gdb_test "-var-set-format weird.integer natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.integer"
|
"set format variable weird.integer"
|
|
|
mi_gdb_test "-var-set-format weird.character natural" \
|
mi_gdb_test "-var-set-format weird.character natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.character"
|
"set format variable weird.character"
|
|
|
mi_gdb_test "-var-set-format weird.char_ptr natural" \
|
mi_gdb_test "-var-set-format weird.char_ptr natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.char_ptr"
|
"set format variable weird.char_ptr"
|
|
|
mi_gdb_test "-var-set-format weird.long_int natural" \
|
mi_gdb_test "-var-set-format weird.long_int natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.long_int"
|
"set format variable weird.long_int"
|
|
|
mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \
|
mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.int_ptr_ptr"
|
"set format variable weird.int_ptr_ptr"
|
|
|
mi_gdb_test "-var-set-format weird.long_array natural" \
|
mi_gdb_test "-var-set-format weird.long_array natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.long_array"
|
"set format variable weird.long_array"
|
|
|
mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
|
mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"set format variable weird.func_ptr"
|
"set format variable weird.func_ptr"
|
|
|
mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
|
mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
|
"\\^done,format=\"hexadecimal\"" \
|
"\\^done,format=\"hexadecimal\"" \
|
"set format variable weird.func_ptr_struct"
|
"set format variable weird.func_ptr_struct"
|
|
|
mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
|
mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.func_ptr_ptr"
|
"set format variable weird.func_ptr_ptr"
|
|
|
mi_gdb_test "-var-set-format weird.u1 natural" \
|
mi_gdb_test "-var-set-format weird.u1 natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.u1"
|
"set format variable weird.u1"
|
|
|
mi_gdb_test "-var-set-format weird.s2 natural" \
|
mi_gdb_test "-var-set-format weird.s2 natural" \
|
"\\^done,format=\"natural\"" \
|
"\\^done,format=\"natural\"" \
|
"set format variable weird.s2"
|
"set format variable weird.s2"
|
|
|
# Test: c_variable-6.25
|
# Test: c_variable-6.25
|
# Desc: value of weird and children
|
# Desc: value of weird and children
|
#gdbtk_test c_variable-6.25 {value of weird and children} {
|
#gdbtk_test c_variable-6.25 {value of weird and children} {
|
# set values {}
|
# set values {}
|
# foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
|
# foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
|
# lappend values [value $v $f]
|
# lappend values [value $v $f]
|
# }
|
# }
|
|
|
# set values
|
# set values
|
#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
|
#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
|
|
|
# Test: c_variable-6.26
|
# Test: c_variable-6.26
|
# Desc: change format of weird and children to octal
|
# Desc: change format of weird and children to octal
|
#gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
|
#gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
|
# set formats {}
|
# set formats {}
|
# foreach v [lsort [array names var]] {
|
# foreach v [lsort [array names var]] {
|
# $var($v) format octal
|
# $var($v) format octal
|
# lappend formats [$var($v) format]
|
# lappend formats [$var($v) format]
|
# }
|
# }
|
|
|
# set formats
|
# set formats
|
#} {octal octal octal octal octal octal octal octal octal octal octal octal}
|
#} {octal octal octal octal octal octal octal octal octal octal octal octal}
|
|
|
# Test: c_variable-6.27
|
# Test: c_variable-6.27
|
# Desc: value of weird and children with new format
|
# Desc: value of weird and children with new format
|
#gdbtk_test c_variable-6.27 {value of foo with new format} {
|
#gdbtk_test c_variable-6.27 {value of foo with new format} {
|
# set values {}
|
# set values {}
|
# foreach v [lsort [array names var]] {
|
# foreach v [lsort [array names var]] {
|
# lappend values [value $v o]
|
# lappend values [value $v o]
|
# }
|
# }
|
|
|
# set values
|
# set values
|
#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
|
#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
|
|
|
# Test: c_variable-6.30
|
# Test: c_variable-6.30
|
# Desc: create more children of weird
|
# Desc: create more children of weird
|
#gdbtk_test c_variable-6.30 {create more children of weird} {
|
#gdbtk_test c_variable-6.30 {create more children of weird} {
|
# foreach v [array names var] {
|
# foreach v [array names var] {
|
# get_children $v
|
# get_children $v
|
# }
|
# }
|
|
|
# # Do it twice to get more children
|
# # Do it twice to get more children
|
# foreach v [array names var] {
|
# foreach v [array names var] {
|
# get_children $v
|
# get_children $v
|
# }
|
# }
|
|
|
# lsort [array names var]
|
# lsort [array names var]
|
#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
|
#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
|
|
|
# Test: c_variable-6.31
|
# Test: c_variable-6.31
|
# Desc: check that all children of weird change
|
# Desc: check that all children of weird change
|
# Ok, obviously things like weird.s2 and weird.u1 will not change!
|
# Ok, obviously things like weird.s2 and weird.u1 will not change!
|
#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
|
#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
|
# $var(weird) value 0x2121
|
# $var(weird) value 0x2121
|
# check_update
|
# check_update
|
#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
|
#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
|
|
|
mi_gdb_test "-var-delete weird" \
|
mi_gdb_test "-var-delete weird" \
|
"\\^done,ndeleted=\"12\"" \
|
"\\^done,ndeleted=\"12\"" \
|
"delete var weird"
|
"delete var weird"
|
|
|
|
|
##### #####
|
##### #####
|
# #
|
# #
|
# Special Display Tests #
|
# Special Display Tests #
|
# #
|
# #
|
##### #####
|
##### #####
|
|
|
# Stop in "do_special_tests"
|
# Stop in "do_special_tests"
|
mi_gdb_test "200-break-insert do_special_tests" \
|
mi_gdb_test "200-break-insert do_special_tests" \
|
"200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \
|
"200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \
|
"break-insert operation"
|
"break-insert operation"
|
|
|
send_gdb "-exec-continue\n"
|
send_gdb "-exec-continue\n"
|
gdb_expect {
|
gdb_expect {
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\{\},file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" {
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\{\},file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" {
|
pass "continue to do_special_tests"
|
pass "continue to do_special_tests"
|
}
|
}
|
timeout {
|
timeout {
|
fail "continue to do_special_tests (timeout)"
|
fail "continue to do_special_tests (timeout)"
|
}
|
}
|
}
|
}
|
|
|
# Test: c_variable-7.10
|
# Test: c_variable-7.10
|
# Desc: create union u
|
# Desc: create union u
|
mi_gdb_test "-var-create u * u" \
|
mi_gdb_test "-var-create u * u" \
|
"\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
|
"\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
|
"create local variable u"
|
"create local variable u"
|
|
|
# Test: c_variable-7.11
|
# Test: c_variable-7.11
|
# Desc: value of u
|
# Desc: value of u
|
mi_gdb_test "-var-evaluate-expression u" \
|
mi_gdb_test "-var-evaluate-expression u" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"eval variable u"
|
"eval variable u"
|
|
|
# Test: c_variable-7.12
|
# Test: c_variable-7.12
|
# Desc: type of u
|
# Desc: type of u
|
mi_gdb_test "-var-info-type u" \
|
mi_gdb_test "-var-info-type u" \
|
"\\^done,type=\"union named_union\"" \
|
"\\^done,type=\"union named_union\"" \
|
"info type variable u"
|
"info type variable u"
|
|
|
# Test: c_variable-7.13
|
# Test: c_variable-7.13
|
# Desc: is u editable
|
# Desc: is u editable
|
mi_gdb_test "-var-show-attributes u" \
|
mi_gdb_test "-var-show-attributes u" \
|
"\\^done,attr=\"noneditable\"" \
|
"\\^done,attr=\"noneditable\"" \
|
"is u editable"
|
"is u editable"
|
|
|
# Test: c_variable-7.14
|
# Test: c_variable-7.14
|
# Desc: number of children of u
|
# Desc: number of children of u
|
mi_gdb_test "-var-info-num-children u" \
|
mi_gdb_test "-var-info-num-children u" \
|
"\\^done,numchild=\"2\"" \
|
"\\^done,numchild=\"2\"" \
|
"get number of children of u"
|
"get number of children of u"
|
|
|
# Test: c_variable-7.15
|
# Test: c_variable-7.15
|
# Desc: children of u
|
# Desc: children of u
|
mi_gdb_test "-var-list-children u" \
|
mi_gdb_test "-var-list-children u" \
|
"\\^done,numchild=\"2\",children=\{child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\}\}" \
|
"\\^done,numchild=\"2\",children=\{child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\}\}" \
|
"get children of u"
|
"get children of u"
|
|
|
# Test: c_variable-7.20
|
# Test: c_variable-7.20
|
# Desc: create anonu
|
# Desc: create anonu
|
mi_gdb_test "-var-create anonu * anonu" \
|
mi_gdb_test "-var-create anonu * anonu" \
|
"\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
|
"\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
|
"create local variable anonu"
|
"create local variable anonu"
|
|
|
# Test: c_variable-7.21
|
# Test: c_variable-7.21
|
# Desc: value of anonu
|
# Desc: value of anonu
|
mi_gdb_test "-var-evaluate-expression anonu" \
|
mi_gdb_test "-var-evaluate-expression anonu" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"eval variable anonu"
|
"eval variable anonu"
|
|
|
# Test: c_variable-7.22
|
# Test: c_variable-7.22
|
# Desc: type of anonu
|
# Desc: type of anonu
|
mi_gdb_test "-var-info-type anonu" \
|
mi_gdb_test "-var-info-type anonu" \
|
"\\^done,type=\"union \{\\.\\.\\.\}\"" \
|
"\\^done,type=\"union \{\\.\\.\\.\}\"" \
|
"info type variable anonu"
|
"info type variable anonu"
|
|
|
# Test: c_variable-7.23
|
# Test: c_variable-7.23
|
# Desc: is anonu editable
|
# Desc: is anonu editable
|
mi_gdb_test "-var-show-attributes anonu" \
|
mi_gdb_test "-var-show-attributes anonu" \
|
"\\^done,attr=\"noneditable\"" \
|
"\\^done,attr=\"noneditable\"" \
|
"is anonu editable"
|
"is anonu editable"
|
|
|
# Test: c_variable-7.24
|
# Test: c_variable-7.24
|
# Desc: number of children of anonu
|
# Desc: number of children of anonu
|
mi_gdb_test "-var-info-num-children anonu" \
|
mi_gdb_test "-var-info-num-children anonu" \
|
"\\^done,numchild=\"3\"" \
|
"\\^done,numchild=\"3\"" \
|
"get number of children of anonu"
|
"get number of children of anonu"
|
|
|
# Test: c_variable-7.25
|
# Test: c_variable-7.25
|
# Desc: children of anonu
|
# Desc: children of anonu
|
mi_gdb_test "-var-list-children anonu" \
|
mi_gdb_test "-var-list-children anonu" \
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
|
"get children of anonu"
|
"get children of anonu"
|
|
|
# Test: c_variable-7.30
|
# Test: c_variable-7.30
|
# Desc: create struct s
|
# Desc: create struct s
|
mi_gdb_test "-var-create s * s" \
|
mi_gdb_test "-var-create s * s" \
|
"\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
|
"\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
|
"create local variable s"
|
"create local variable s"
|
|
|
|
|
# Test: c_variable-7.31
|
# Test: c_variable-7.31
|
# Desc: value of s
|
# Desc: value of s
|
mi_gdb_test "-var-evaluate-expression s" \
|
mi_gdb_test "-var-evaluate-expression s" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"eval variable s"
|
"eval variable s"
|
|
|
# Test: c_variable-7.32
|
# Test: c_variable-7.32
|
# Desc: type of s
|
# Desc: type of s
|
mi_gdb_test "-var-info-type s" \
|
mi_gdb_test "-var-info-type s" \
|
"\\^done,type=\"struct _simple_struct\"" \
|
"\\^done,type=\"struct _simple_struct\"" \
|
"info type variable s"
|
"info type variable s"
|
|
|
# Test: c_variable-7.33
|
# Test: c_variable-7.33
|
# Desc: is s editable
|
# Desc: is s editable
|
mi_gdb_test "-var-show-attributes s" \
|
mi_gdb_test "-var-show-attributes s" \
|
"\\^done,attr=\"noneditable\"" \
|
"\\^done,attr=\"noneditable\"" \
|
"is s editable"
|
"is s editable"
|
|
|
# Test: c_variable-7.34
|
# Test: c_variable-7.34
|
# Desc: number of children of s
|
# Desc: number of children of s
|
mi_gdb_test "-var-info-num-children s" \
|
mi_gdb_test "-var-info-num-children s" \
|
"\\^done,numchild=\"6\"" \
|
"\\^done,numchild=\"6\"" \
|
"get number of children of s"
|
"get number of children of s"
|
|
|
# Test: c_variable-7.35
|
# Test: c_variable-7.35
|
# Desc: children of s
|
# Desc: children of s
|
mi_gdb_test "-var-list-children s" \
|
mi_gdb_test "-var-list-children s" \
|
"\\^done,numchild=\"6\",children=\{child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\}" \
|
"\\^done,numchild=\"6\",children=\{child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\}" \
|
"get children of s"
|
"get children of s"
|
#} {integer unsigned_integer character signed_character char_ptr array_of_10}
|
#} {integer unsigned_integer character signed_character char_ptr array_of_10}
|
|
|
# Test: c_variable-7.40
|
# Test: c_variable-7.40
|
# Desc: create anons
|
# Desc: create anons
|
mi_gdb_test "-var-create anons * anons" \
|
mi_gdb_test "-var-create anons * anons" \
|
"\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
|
"\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
|
"create local variable anons"
|
"create local variable anons"
|
|
|
# Test: c_variable-7.41
|
# Test: c_variable-7.41
|
# Desc: value of anons
|
# Desc: value of anons
|
mi_gdb_test "-var-evaluate-expression anons" \
|
mi_gdb_test "-var-evaluate-expression anons" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"\\^done,value=\"\{\\.\\.\\.\}\"" \
|
"eval variable anons"
|
"eval variable anons"
|
|
|
# Test: c_variable-7.42
|
# Test: c_variable-7.42
|
# Desc: type of anons
|
# Desc: type of anons
|
mi_gdb_test "-var-info-type anons" \
|
mi_gdb_test "-var-info-type anons" \
|
"\\^done,type=\"struct \{\\.\\.\\.\}\"" \
|
"\\^done,type=\"struct \{\\.\\.\\.\}\"" \
|
"info type variable anons"
|
"info type variable anons"
|
|
|
# Test: c_variable-7.43
|
# Test: c_variable-7.43
|
# Desc: is anons editable
|
# Desc: is anons editable
|
mi_gdb_test "-var-show-attributes anons" \
|
mi_gdb_test "-var-show-attributes anons" \
|
"\\^done,attr=\"noneditable\"" \
|
"\\^done,attr=\"noneditable\"" \
|
"is anons editable"
|
"is anons editable"
|
|
|
# Test: c_variable-7.44
|
# Test: c_variable-7.44
|
# Desc: number of children of anons
|
# Desc: number of children of anons
|
mi_gdb_test "-var-info-num-children anons" \
|
mi_gdb_test "-var-info-num-children anons" \
|
"\\^done,numchild=\"3\"" \
|
"\\^done,numchild=\"3\"" \
|
"get number of children of anons"
|
"get number of children of anons"
|
|
|
# Test: c_variable-7.45
|
# Test: c_variable-7.45
|
# Desc: children of anons
|
# Desc: children of anons
|
mi_gdb_test "-var-list-children anons" \
|
mi_gdb_test "-var-list-children anons" \
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
|
"get children of anons"
|
"get children of anons"
|
|
|
|
|
# Test: c_variable-7.50
|
# Test: c_variable-7.50
|
# Desc: create enum e
|
# Desc: create enum e
|
mi_gdb_test "-var-create e * e" \
|
mi_gdb_test "-var-create e * e" \
|
"\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
|
"\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
|
"create local variable e"
|
"create local variable e"
|
|
|
setup_xfail "*-*-*"
|
setup_xfail "*-*-*"
|
# Test: c_variable-7.51
|
# Test: c_variable-7.51
|
# Desc: value of e
|
# Desc: value of e
|
mi_gdb_test "-var-evaluate-expression e" \
|
mi_gdb_test "-var-evaluate-expression e" \
|
"\\^done,value=\"FIXME\"" \
|
"\\^done,value=\"FIXME\"" \
|
"eval variable e"
|
"eval variable e"
|
clear_xfail "*-*-*"
|
clear_xfail "*-*-*"
|
|
|
# Test: c_variable-7.52
|
# Test: c_variable-7.52
|
# Desc: type of e
|
# Desc: type of e
|
mi_gdb_test "-var-info-type e" \
|
mi_gdb_test "-var-info-type e" \
|
"\\^done,type=\"enum foo\"" \
|
"\\^done,type=\"enum foo\"" \
|
"info type variable e"
|
"info type variable e"
|
|
|
# Test: c_variable-7.53
|
# Test: c_variable-7.53
|
# Desc: is e editable
|
# Desc: is e editable
|
mi_gdb_test "-var-show-attributes e" \
|
mi_gdb_test "-var-show-attributes e" \
|
"\\^done,attr=\"editable\"" \
|
"\\^done,attr=\"editable\"" \
|
"is e editable"
|
"is e editable"
|
|
|
# Test: c_variable-7.54
|
# Test: c_variable-7.54
|
# Desc: number of children of e
|
# Desc: number of children of e
|
mi_gdb_test "-var-info-num-children e" \
|
mi_gdb_test "-var-info-num-children e" \
|
"\\^done,numchild=\"0\"" \
|
"\\^done,numchild=\"0\"" \
|
"get number of children of e"
|
"get number of children of e"
|
|
|
# Test: c_variable-7.55
|
# Test: c_variable-7.55
|
# Desc: children of e
|
# Desc: children of e
|
mi_gdb_test "-var-list-children e" \
|
mi_gdb_test "-var-list-children e" \
|
"\\^done,numchild=\"0\"" \
|
"\\^done,numchild=\"0\"" \
|
"get children of e"
|
"get children of e"
|
|
|
# Test: c_variable-7.60
|
# Test: c_variable-7.60
|
# Desc: create anone
|
# Desc: create anone
|
mi_gdb_test "-var-create anone * anone" \
|
mi_gdb_test "-var-create anone * anone" \
|
"\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
|
"\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
|
"create local variable anone"
|
"create local variable anone"
|
|
|
setup_xfail "*-*-*"
|
setup_xfail "*-*-*"
|
# Test: c_variable-7.61
|
# Test: c_variable-7.61
|
# Desc: value of anone
|
# Desc: value of anone
|
mi_gdb_test "-var-evaluate-expression anone" \
|
mi_gdb_test "-var-evaluate-expression anone" \
|
"\\^done,value=\"A\"" \
|
"\\^done,value=\"A\"" \
|
"eval variable anone"
|
"eval variable anone"
|
clear_xfail "*-*-*"
|
clear_xfail "*-*-*"
|
|
|
|
|
# Test: c_variable-7.70
|
# Test: c_variable-7.70
|
# Desc: create anone
|
# Desc: create anone
|
mi_gdb_test "-var-create anone * anone" \
|
mi_gdb_test "-var-create anone * anone" \
|
"&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \
|
"&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \
|
"create duplicate local variable anone"
|
"create duplicate local variable anone"
|
|
|
|
|
# Test: c_variable-7.72
|
# Test: c_variable-7.72
|
# Desc: type of anone
|
# Desc: type of anone
|
mi_gdb_test "-var-info-type anone" \
|
mi_gdb_test "-var-info-type anone" \
|
"\\^done,type=\"enum \{\\.\\.\\.\}\"" \
|
"\\^done,type=\"enum \{\\.\\.\\.\}\"" \
|
"info type variable anone"
|
"info type variable anone"
|
|
|
|
|
# Test: c_variable-7.73
|
# Test: c_variable-7.73
|
# Desc: is anone editable
|
# Desc: is anone editable
|
mi_gdb_test "-var-show-attributes anone" \
|
mi_gdb_test "-var-show-attributes anone" \
|
"\\^done,attr=\"editable\"" \
|
"\\^done,attr=\"editable\"" \
|
"is anone editable"
|
"is anone editable"
|
|
|
# Test: c_variable-7.74
|
# Test: c_variable-7.74
|
# Desc: number of children of anone
|
# Desc: number of children of anone
|
mi_gdb_test "-var-info-num-children anone" \
|
mi_gdb_test "-var-info-num-children anone" \
|
"\\^done,numchild=\"0\"" \
|
"\\^done,numchild=\"0\"" \
|
"get number of children of anone"
|
"get number of children of anone"
|
|
|
# Test: c_variable-7.75
|
# Test: c_variable-7.75
|
# Desc: children of anone
|
# Desc: children of anone
|
mi_gdb_test "-var-list-children anone" \
|
mi_gdb_test "-var-list-children anone" \
|
"\\^done,numchild=\"0\"" \
|
"\\^done,numchild=\"0\"" \
|
"get children of anone"
|
"get children of anone"
|
|
|
|
|
# Record fp
|
# Record fp
|
|
|
send_gdb "p/x \$fp\n"
|
send_gdb "p/x \$fp\n"
|
gdb_expect {
|
gdb_expect {
|
-re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" {
|
-re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" {
|
pass "print FP register"
|
pass "print FP register"
|
set fp $expect_out(1,string)
|
set fp $expect_out(1,string)
|
}
|
}
|
# -re ".*" { fail "print FP register"}
|
# -re ".*" { fail "print FP register"}
|
timeout { fail "print FP register (timeout)"}
|
timeout { fail "print FP register (timeout)"}
|
}
|
}
|
|
|
mi_gdb_test "200-break-insert incr_a" \
|
mi_gdb_test "200-break-insert incr_a" \
|
"200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \
|
"200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \
|
"break-insert operation"
|
"break-insert operation"
|
send_gdb "-exec-continue\n"
|
send_gdb "-exec-continue\n"
|
gdb_expect {
|
gdb_expect {
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\"2\.*\"\}\},file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\"2\.*\"\}\},file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
|
pass "continue to incr_a"
|
pass "continue to incr_a"
|
}
|
}
|
timeout {
|
timeout {
|
fail "continue to incr_a (timeout)"
|
fail "continue to incr_a (timeout)"
|
}
|
}
|
}
|
}
|
|
|
# Test: c_variable-7.81
|
# Test: c_variable-7.81
|
# Desc: Create variables in different scopes
|
# Desc: Create variables in different scopes
|
mi_gdb_test "-var-create a1 * a" \
|
mi_gdb_test "-var-create a1 * a" \
|
"\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
|
"\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
|
"create local variable a1"
|
"create local variable a1"
|
|
|
mi_gdb_test "-var-create a2 $fp a" \
|
mi_gdb_test "-var-create a2 $fp a" \
|
"\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
|
"\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
|
"create variable a2 in different scope"
|
"create variable a2 in different scope"
|
|
|
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
|
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
|
# set a1 [gdb_variable create -expr a]
|
# set a1 [gdb_variable create -expr a]
|
# set a2 [gdb_variable create -expr a -frame $fp]
|
# set a2 [gdb_variable create -expr a -frame $fp]
|
|
|
# set vals {}
|
# set vals {}
|
# lappend vals [$a1 value]
|
# lappend vals [$a1 value]
|
# lappend vals [$a2 value]
|
# lappend vals [$a2 value]
|
# set vals
|
# set vals
|
#} {2 1}
|
#} {2 1}
|
|
|
|
|
mi_gdb_exit
|
mi_gdb_exit
|
return 0
|
return 0
|
|
|
# Local variables:
|
# Local variables:
|
# change-log-default-name: "ChangeLog-mi"
|
# change-log-default-name: "ChangeLog-mi"
|
# End:
|
# End:
|
|
|
|
|
|
|
|
|
|
|