aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-01-17 14:34:22 +0000
committerPedro Alves <palves@redhat.com>2008-01-17 14:34:22 +0000
commitc7dd36a1722af6c8d128431588d4e5cf44f69b73 (patch)
tree36d603d4ea548c363353cfe25cde52c8c12de867 /gdb
parentc70bd6f33eaf92e13835e2535ccad0b96155c014 (diff)
downloadgdb-c7dd36a1722af6c8d128431588d4e5cf44f69b73.zip
gdb-c7dd36a1722af6c8d128431588d4e5cf44f69b73.tar.gz
gdb-c7dd36a1722af6c8d128431588d4e5cf44f69b73.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.c8
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.exp4
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-child.exp4
-rw-r--r--gdb/testsuite/gdb.mi/var-cmd.c8
5 files changed, 26 insertions, 8 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 296b2cb..74099f6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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.
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.c b/gdb/testsuite/gdb.mi/mi-var-child.c
index 4912c4f..25aed8b 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.c
+++ b/gdb/testsuite/gdb.mi/mi-var-child.c
@@ -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;
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index 9099127..bdb7a1a 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -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
diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp
index d99abec..91ada0f 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp
@@ -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
diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c
index 7a4b715..4216461 100644
--- a/gdb/testsuite/gdb.mi/var-cmd.c
+++ b/gdb/testsuite/gdb.mi/var-cmd.c
@@ -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;