This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: tests for MI commands


This patch provides tests for the recent changes to -var-update and
-var-list-children.  I have also revised the test for stack-list-locals
so that it properly tests the --simple-values option.

There is no test for "-var-update --simple-values" as I could not get it
to behave differently for "-var-update --all-values".  I think this is
because the changelist only consists of simple types; if it is complex
its `value' is deemed not have changed.

Nick


2005-07-20  Nick Roberts  <nickrob@snap.net.nz>

	* gdb.mi/var-cmd.c: Give long_array in _struct_decl 12 elements.
	(do_children_tests): Assign values to the extra elements.

	* gdb.mi/mi-var-child.exp: Adapt tests for extra elements and use
	them for tests for "-var-update --no-values" and
	"-var-update --all-values".  
	Add test for "-var-list-children --simple-values.

	* gdb.mi/basics.c (callee4): Add integer array D[3]...

	* gdb.mi/mi-stack.exp (test_stack_locals_listing): ...to test
	"-stack-list-locals --simple-values".  Improve doc strings and
	comments.


*** gdb.mi/var-cmd.c.~1.3.~	2004-09-28 23:54:51.000000000 +1200
--- gdb.mi/var-cmd.c	2005-07-20 16:20:40.000000000 +1200
***************
*** 1,4 ****
! /* Copyright 1999, 2004 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
--- 1,4 ----
! /* Copyright 1999, 2004, 2005 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
*************** typedef struct _struct_decl {
*** 51,57 ****
    char *char_ptr;
    long  long_int;
    int  **int_ptr_ptr;
!   long  long_array[10];
  
    void (*func_ptr) (void);
    struct _struct_decl (*func_ptr_struct) (int, char *, long);
--- 51,57 ----
    char *char_ptr;
    long  long_int;
    int  **int_ptr_ptr;
!   long  long_array[12];
  
    void (*func_ptr) (void);
    struct _struct_decl (*func_ptr_struct) (int, char *, long);
*************** do_children_tests (void)
*** 227,232 ****
--- 227,234 ----
    struct_declarations.long_array[9] = 1234;
  
    weird->func_ptr = nothing;
+   struct_declarations.long_array[10] = 3456;
+   struct_declarations.long_array[11] = 5678;
  
    /* Struct/pointer/array tests */
    a0 = '0';

*** gdb.mi/mi-var-child.exp.~1.17~	2005-07-15 15:03:03.000000000 +1200
--- gdb.mi/mi-var-child.exp	2005-07-20 16:21:52.000000000 +1200
***************
*** 1,4 ****
! # Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation
  
  # 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
--- 1,4 ----
! # Copyright 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation
  
  # 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
*************** mi_gdb_test "-var-create struct_declarat
*** 59,65 ****
  # STABS doesn't give us argument types for the func ptr structs, but
  # Dwarf 2 does.
  mi_gdb_test "-var-list-children struct_declarations" \
! 	"\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
  	"get children of struct_declarations"
  
  #gdbtk_test c_variable-4.3 {children of struct_declarations} {
--- 59,65 ----
  # STABS doesn't give us argument types for the func ptr structs, but
  # Dwarf 2 does.
  mi_gdb_test "-var-list-children struct_declarations" \
! 	"\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"12\",type=\"long int \\\[12\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
  	"get children of struct_declarations"
  
  #gdbtk_test c_variable-4.3 {children of struct_declarations} {
*************** mi_gdb_test "-var-info-num-children stru
*** 140,152 ****
  # Test: c_variable-4.15
  # Desc: children of struct_declarations.long_array
  mi_gdb_test "-var-list-children struct_declarations.long_array" \
! 	"\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
  	"get children of struct_declarations.long_array"
  
  # Test: c_variable-4.16
  # Desc: number of children of struct_declarations.long_array
  mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
! 	"\\^done,numchild=\"10\"" \
  	"get number of children of struct_declarations.long_array"
  
  # Test: c_variable-4.17
--- 140,152 ----
  # Test: c_variable-4.15
  # Desc: children of struct_declarations.long_array
  mi_gdb_test "-var-list-children struct_declarations.long_array" \
! 	"\\^done,numchild=\"12\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.10\",exp=\"10\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.11\",exp=\"11\",numchild=\"0\",type=\"long int\"\}\\\]" \
  	"get children of struct_declarations.long_array"
  
  # Test: c_variable-4.16
  # Desc: number of children of struct_declarations.long_array
  mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
! 	"\\^done,numchild=\"12\"" \
  	"get number of children of struct_declarations.long_array"
  
  # Test: c_variable-4.17
*************** mi_gdb_test "-var-create weird * weird" 
*** 565,571 ****
  # Test: c_variable-4.82
  # Desc: children of 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 \{\\.\\.\\.\}\"\}\\\]" \
  	"get children of weird"
  
  # Test: c_variable-4.83
--- 565,571 ----
  # Test: c_variable-4.82
  # Desc: children of 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=\"12\",type=\"long int \\\[12\\\]\"\},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 \{\\.\\.\\.\}\"\}\\\]" \
  	"get children of weird"
  
  # Test: c_variable-4.83
*************** mi_gdb_test "-var-info-num-children weir
*** 578,593 ****
  # Test: c_variable-4.84
  # Desc: children of weird->long_array
  mi_gdb_test "-var-list-children weird.long_array" \
! 	"\\^done,numchild=\"10\",children=\\\[child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
  	"get children of weird.long_array"
  #gdbtk_test c_variable-4.84 {children of weird->long_array} {
  #  get_children weird.long_array
! #} {0 1 2 3 4 5 6 7 8 9}
  
  # Test: c_variable-4.85
  # Desc: number of children of weird.long_array
  mi_gdb_test "-var-info-num-children weird.long_array" \
! 	"\\^done,numchild=\"10\"" \
  	"get number of children of weird.long_array"
  
  # Test: c_variable-4.86
--- 578,593 ----
  # Test: c_variable-4.84
  # Desc: children of weird->long_array
  mi_gdb_test "-var-list-children weird.long_array" \
! 	"\\^done,numchild=\"12\",children=\\\[child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.10\",exp=\"10\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.11\",exp=\"11\",numchild=\"0\",type=\"long int\"\}\\\]" \
  	"get children of weird.long_array"
  #gdbtk_test c_variable-4.84 {children of weird->long_array} {
  #  get_children weird.long_array
! #} {0 1 2 3 4 5 6 7 8 9 10 11}
  
  # Test: c_variable-4.85
  # Desc: number of children of weird.long_array
  mi_gdb_test "-var-info-num-children weird.long_array" \
! 	"\\^done,numchild=\"12\"" \
  	"get number of children of weird.long_array"
  
  # Test: c_variable-4.86
*************** mi_gdb_test "-var-show-attributes struct
*** 736,742 ****
  	"is struct_declarations editable"
  
  mi_gdb_test "-var-delete weird" \
! 	"\\^done,ndeleted=\"24\"" \
  	"delete var weird"
  
  #####                         #####
--- 736,742 ----
  	"is struct_declarations editable"
  
  mi_gdb_test "-var-delete weird" \
! 	"\\^done,ndeleted=\"26\"" \
  	"delete var weird"
  
  #####                         #####
*************** mi_gdb_test "-var-update *" \
*** 833,846 ****
  	"\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
  	"update all vars struct_declarations.long_array.3-9 changed"
  
- mi_gdb_test "-var-list-children --all-values struct_declarations.long_array" \
-         "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",value=\"1234\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",value=\"2345\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",value=\"3456\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",value=\"4567\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",value=\"5678\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",value=\"6789\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",value=\"7890\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",value=\"8901\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",value=\"9012\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",value=\"1234\",type=\"long int\"\}\\\]" \
-                 "listing of names and values of children"
  
! # Step over "weird->func_ptr = nothing;"
! set line_dct_a0_0 [gdb_get_line_number "a0 = '0';"]
  mi_step_to do_children_tests {} {.*var-cmd.c} \
!     $line_dct_a0_0 "step \$line_dct_a0_0"
  
  # Test: c_variable-5.9
  # Desc: check that func_ptr changed
--- 833,842 ----
  	"\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
  	"update all vars struct_declarations.long_array.3-9 changed"
  
  
! # Step over weird->func_ptr = nothing;
  mi_step_to do_children_tests {} {.*var-cmd.c} \
!     [expr $line_dct_nothing + 1] "step \$line_dct_nothing + 1"
  
  # Test: c_variable-5.9
  # Desc: check that func_ptr changed
*************** mi_gdb_test "-var-update *" \
*** 848,856 ****
  	"\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
  	"update all vars struct_declarations.func_ptr changed"
  
  # Delete all variables
  mi_gdb_test "-var-delete struct_declarations" \
! 	"\\^done,ndeleted=\"65\"" \
  	"delete var struct_declarations"
  
  mi_gdb_test "-var-delete weird->int_ptr_ptr" \
--- 844,877 ----
  	"\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
  	"update all vars struct_declarations.func_ptr changed"
  
+ # Step overstruct_declarations.long_array[10] = 3456;
+ mi_step_to do_children_tests {} {.*var-cmd.c} \
+     [expr $line_dct_nothing + 2] "step \$line_dct_nothing + 2"
+ 
+ mi_gdb_test "-var-update --no-values *" \
+ 	"\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+  "update  all vars struct_declarations.long_array.10 changed, don't print values."
+ 
+ # Step over struct_declarations.long_array[11] = 5678;
+ set line_dct_a0_0 [gdb_get_line_number "a0 = '0';"]
+ mi_step_to  do_children_tests {} {.*var-cmd.c} \
+     $line_dct_a0_0 "step \$line_dct_a0_0"
+ 
+ mi_gdb_test "-var-update --all-values *" \
+ 	"\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+  "update all vars struct_declarations.long_array.11 changed, print values."
+ 
+ mi_gdb_test "-var-list-children --all-values struct_declarations.long_array" \
+         "\\^done,numchild=\"12\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",value=\"1234\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",value=\"2345\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",value=\"3456\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",value=\"4567\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",value=\"5678\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",value=\"6789\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",value=\"7890\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",value=\"8901\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",value=\"9012\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",value=\"1234\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.10\",exp=\"10\",numchild=\"0\",value=\"3456\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.11\",exp=\"11\",numchild=\"0\",value=\"5678\",type=\"long int\"\}\\\]" \
+                 "listing of names and values of children"
+ 
+ mi_gdb_test "-var-list-children --simple-values struct_declarations" \
+         "\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",value=\"123\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",value=\"0 '\\\\\\\\0'\",type=\"char\"\},child=\{name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",value=\"$hex \\\\\"hello\\\\\"\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",value=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"12\",type=\"long int \\\[12\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",value=\"$hex <nothing>\",type=\"void \\(\\*\\)\\(void\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",value=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(int, char \\*, long int\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",value=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(int, char \\*, long int\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{...\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{...\}\"\}\\\]" \
+   "listing of children, simple types: names, type and values, complex types: names and types"
+ 
  # Delete all variables
  mi_gdb_test "-var-delete struct_declarations" \
! 	"\\^done,ndeleted=\"67\"" \
  	"delete var struct_declarations"
  
  mi_gdb_test "-var-delete weird->int_ptr_ptr" \

*** gdb.mi/mi-stack.exp.~1.16.~	2005-06-19 18:49:18.000000000 +1200
--- gdb.mi/mi-stack.exp	2005-07-20 16:20:07.000000000 +1200
*************** proc test_stack_locals_listing {} {
*** 152,170 ****
  
      # Obtain lists for locals for the stack frames
      # Tests:
!     # -stack-list-locals 0
!     # -stack-list-locals 1
!     # -stack-list-locals 2
      # -stack-list-arguments 
  
      mi_gdb_test "232-stack-list-locals 0" \
! 	    "232\\^done,locals=\\\[name=\"A\",name=\"B\",name=\"C\"\\\]" \
!                 "stack locals listing 0"
  
  set line_callee4_return_0 [gdb_get_line_number "return 0;"]
  
! # step until A, B, C, have some reasonable values.
! send_gdb "-exec-next 3\n"
  gdb_expect {
      -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
  	pass "next's in callee4"
--- 152,170 ----
  
      # Obtain lists for locals for the stack frames
      # Tests:
!     # -stack-list-locals 0 (--no-values)
!     # -stack-list-locals 1 (--all-values)
!     # -stack-list-locals 2 (--simple-values)
      # -stack-list-arguments 
  
      mi_gdb_test "232-stack-list-locals 0" \
!   "232\\^done,locals=\\\[name=\"A\",name=\"B\",name=\"C\",name=\"D\"\\\]" \
!                 "stack locals listing of names"
  
  set line_callee4_return_0 [gdb_get_line_number "return 0;"]
  
! # step until A, B, C, D have some reasonable values.
! send_gdb "-exec-next 4\n"
  gdb_expect {
      -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
  	pass "next's in callee4"
*************** gdb_expect {
*** 173,184 ****
  }
  
      mi_gdb_test "232-stack-list-locals 1" \
! 	    "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \
!                 "stack locals listing 1"
  
      mi_gdb_test "232-stack-list-locals 2" \
! 	    "232\\^done,locals=\\\[\{name=\"A\",type=\"int\",value=\"1\"\},\{name=\"B\",type=\"int\",value=\"2\"\},\{name=\"C\",type=\"int\",value=\"3\"\}\\\]" \
!                 "stack locals listing 2"
  
      mi_gdb_test "234-stack-list-locals" \
  	    "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
--- 173,184 ----
  }
  
      mi_gdb_test "232-stack-list-locals 1" \
!     "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\},\{name=\"D\",value=\"\\{0, 1, 2\\}\"\}\\\]" \
!                 "stack locals listing of names and values"
  
      mi_gdb_test "232-stack-list-locals 2" \
! 	    "232\\^done,locals=\\\[\{name=\"A\",type=\"int\",value=\"1\"\},\{name=\"B\",type=\"int\",value=\"2\"\},\{name=\"C\",type=\"int\",value=\"3\"\},\{name=\"D\",type=\"int \\\[3\\\]\"\}\\\]" \
!   "stack locals listing, simple types: names and values, complex type: names and types"
  
      mi_gdb_test "234-stack-list-locals" \
  	    "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \

*** gdb.mi/var-cmd.c.~1.3.~	2004-09-28 23:54:51.000000000 +1200
--- gdb.mi/var-cmd.c	2005-07-20 16:20:40.000000000 +1200
***************
*** 1,4 ****
! /* Copyright 1999, 2004 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
--- 1,4 ----
! /* Copyright 1999, 2004, 2005 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
*************** typedef struct _struct_decl {
*** 51,57 ****
    char *char_ptr;
    long  long_int;
    int  **int_ptr_ptr;
!   long  long_array[10];
  
    void (*func_ptr) (void);
    struct _struct_decl (*func_ptr_struct) (int, char *, long);
--- 51,57 ----
    char *char_ptr;
    long  long_int;
    int  **int_ptr_ptr;
!   long  long_array[12];
  
    void (*func_ptr) (void);
    struct _struct_decl (*func_ptr_struct) (int, char *, long);
*************** do_children_tests (void)
*** 227,232 ****
--- 227,234 ----
    struct_declarations.long_array[9] = 1234;
  
    weird->func_ptr = nothing;
+   struct_declarations.long_array[10] = 3456;
+   struct_declarations.long_array[11] = 5678;
  
    /* Struct/pointer/array tests */
    a0 = '0';

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]