]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb.mi/mi-var-child.c (do_children_tests): Add 'dummy' integer
authorPedro Alves <palves@redhat.com>
Thu, 17 Jan 2008 14:34:22 +0000 (14:34 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 17 Jan 2008 14:34:22 +0000 (14:34 +0000)
and 'dummy_ptr' integer pointer.  Initialize struct_declarations
with dummy_ptr's address.
* gdb.mi/var-cmd.c (do_children_tests): Likewise.
* gdb.mi/mi-var-child.exp: int_ptr_ptr is now always "editable" on
all targets.
* gdb.mi/mi2-var-child.exp: Likewise.

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

index 296b2cb10e3719d7e1c58edc560da079af249885..74099f60124edda9c6bd3ead2e6f20e87ba87747 100644 (file)
@@ -1,3 +1,13 @@
+2008-01-17  Pedro Alves  <pedro@codesourcery.com>
+
+       * gdb.mi/mi-var-child.c (do_children_tests): Add 'dummy' integer
+       and 'dummy_ptr' integer pointer.  Initialize struct_declarations
+       with dummy_ptr's address.
+       * gdb.mi/var-cmd.c (do_children_tests): Likewise.
+       * gdb.mi/mi-var-child.exp: int_ptr_ptr is now always "editable" on
+       all targets.
+       * gdb.mi/mi2-var-child.exp: Likewise.
+
 2008-01-09  Joel Brobecker  <brobecker@adacore.com>
 
        * gdb.ada/null_array: New test program.
index 4912c4f4b9677e291bbcf50e8dbc6ef6ef1aa87e..25aed8b9d20b4d13e0b4ed2496e75200838f2c11 100644 (file)
@@ -206,8 +206,12 @@ do_children_tests (void)
   int *foo;
   int bar;
 
-  struct _struct_decl struct_declarations;
-  memset (&struct_declarations, 0, sizeof (struct_declarations));
+  /* Avoid pointing into NULL, as that is editable on some
+     systems.  */
+  int dummy;
+  int *dummy_ptr = &dummy;
+
+  struct _struct_decl struct_declarations = { 0, 0, NULL, 0, &dummy_ptr };
   weird = &struct_declarations;
 
   struct_declarations.integer = 123;
index 9099127cc4e592dcd567ae87471608e002055645..bdb7a1a141b17ee3fa99463875949bc339feddb5 100644 (file)
@@ -682,13 +682,13 @@ mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \
 # Test: c_variable-4.99
 # Desc: is *(weird->int_ptr_ptr) editable
 mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \
-       "\\^done,attr=\"noneditable\"" \
+       "\\^done,attr=\"editable\"" \
        "is weird.int_ptr_ptr.*int_ptr_ptr editable"
 
 # Test: c_variable-4.100
 # Desc: is *(*(weird->int_ptr_ptr)) editable
 mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \
-       "\\^done,attr=\"noneditable\"" \
+       "\\^done,attr=\"editable\"" \
        "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"
 
 # Test: c_variable-4.101
index d99abec4399e721d56440c94b54803e27415fc7a..91ada0f85237837fc0edd943888257ee48e5657b 100644 (file)
@@ -681,13 +681,13 @@ mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \
 # Test: c_variable-4.99
 # Desc: is *(weird->int_ptr_ptr) editable
 mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \
-       "\\^done,attr=\"noneditable\"" \
+       "\\^done,attr=\"editable\"" \
        "is weird.int_ptr_ptr.*int_ptr_ptr editable"
 
 # Test: c_variable-4.100
 # Desc: is *(*(weird->int_ptr_ptr)) editable
 mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \
-       "\\^done,attr=\"noneditable\"" \
+       "\\^done,attr=\"editable\"" \
        "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"
 
 # Test: c_variable-4.101
index 7a4b715e76dcbdfcabc661a4c2de7a01e6f14b4f..42164617134fed4af20e4246f9ebd6a8fe62b723 100644 (file)
@@ -210,8 +210,12 @@ do_children_tests (void)
   int *foo;
   int bar;
 
-  struct _struct_decl struct_declarations;
-  memset (&struct_declarations, 0, sizeof (struct_declarations));
+  /* Avoid pointing into NULL, as that is editable on some
+     systems.  */
+  int dummy;
+  int *dummy_ptr = &dummy;
+
+  struct _struct_decl struct_declarations = { 0, 0, NULL, 0, &dummy_ptr };
   weird = &struct_declarations;
 
   struct_declarations.integer = 123;