* gdb.mi/var-cmd.c (do_children_tests): Initialize
authorVladimir Prus <vladimir@codesourcery.com>
Thu, 27 Sep 2007 12:25:20 +0000 (12:25 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Thu, 27 Sep 2007 12:25:20 +0000 (12:25 +0000)
        the 'struct_declarations' variable to zeros.
        * gdb.mi/mi2-var-child.exp: Step over said
        initialization.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/mi2-var-child.exp
gdb/testsuite/gdb.mi/var-cmd.c

index 4beda4853049dced05a74aca8719a5ffe7000360..63b5f7a3b12916c62b318d80b5e1c72e951e6d97 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-27  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * gdb.mi/var-cmd.c (do_children_tests): Initialize
+       the 'struct_declarations' variable to zeros.
+       * gdb.mi/mi2-var-child.exp: Step over said
+       initialization.
+       
 2007-09-24  Vladimir Prus  <vladimir@codesourcery.com>
 
        * gdb.cp/mb-ctor.cc: New.
index 91ada0f85237837fc0edd943888257ee48e5657b..450f508f2ed3bcb8b2d7921edbeb00635bde66b9 100644 (file)
@@ -50,6 +50,10 @@ mi_continue_to_line $line_dlt_first_real "step to real start of do_children_test
 #                #
 #####        #####
 
+# Step to "weird = &struct_declarations;"
+set line_dct_weird [gdb_get_line_number "weird = &struct_declarations;"]
+mi_next_to do_children_tests {} {.*var-cmd.c} \
+      $line_dct_weird "step to line \$line_dct_weird"
 
 # Test: c_variable-4.2
 # Desc: create variable "struct_declarations"
index c9b1c535a65aaa54797d97db3bd453a184caf97b..60a5b7b3af7f835938e2ad8f4945b7e63114ea88 100644 (file)
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <string.h>
 
 struct _simple_struct {
   int integer;
@@ -210,6 +211,7 @@ do_children_tests (void)
   int bar;
 
   struct _struct_decl struct_declarations;
+  memset (&struct_declarations, 0, sizeof (struct_declarations));
   weird = &struct_declarations;
 
   struct_declarations.integer = 123;