aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-02-23 17:01:54 +0000
committerPedro Alves <palves@redhat.com>2010-02-23 17:01:54 +0000
commitcfce2ea2f1d31e7a2efe7c4b5e93fcd35c994d17 (patch)
treefb4655449ffcac5170162678b2dda0d80846a62c
parent0c13f7cc0268dce3cb7853c3b68af981145825a2 (diff)
downloadgdb-cfce2ea2f1d31e7a2efe7c4b5e93fcd35c994d17.zip
gdb-cfce2ea2f1d31e7a2efe7c4b5e93fcd35c994d17.tar.gz
gdb-cfce2ea2f1d31e7a2efe7c4b5e93fcd35c994d17.tar.bz2
2010-02-23 Harald Koenig <H.Koenig@science-computing.de>
* varobj.c (varobj_update): Avoid non-constants in initializers.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/varobj.c18
2 files changed, 16 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d5fd34e..4abb6af 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-23 Harald Koenig <H.Koenig@science-computing.de>
+
+ * varobj.c (varobj_update): Avoid non-constants in initializers.
+
2010-02-23 Tom Tromey <tromey@redhat.com>
* dwarf2loc.c (read_pieced_value) <DWARF_VALUE_STACK>: Correctly
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 6ec87b3..b4b2461 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1700,7 +1700,8 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
if (!(*varp)->root->is_valid)
{
- varobj_update_result r = {*varp};
+ varobj_update_result r = {0};
+ r.varobj = *varp;
r.status = VAROBJ_INVALID;
VEC_safe_push (varobj_update_result, result, &r);
return result;
@@ -1708,7 +1709,8 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
if ((*varp)->root->rootvar == *varp)
{
- varobj_update_result r = {*varp};
+ varobj_update_result r = {0};
+ r.varobj = *varp;
r.status = VAROBJ_IN_SCOPE;
/* Update the root variable. value_of_root can return NULL
@@ -1738,7 +1740,8 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
}
else
{
- varobj_update_result r = {*varp};
+ varobj_update_result r = {0};
+ r.varobj = *varp;
VEC_safe_push (varobj_update_result, stack, &r);
}
@@ -1815,7 +1818,8 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
for (i = VEC_length (varobj_p, changed) - 1; i >= 0; --i)
{
varobj_p tmp = VEC_index (varobj_p, changed, i);
- varobj_update_result r = {tmp};
+ varobj_update_result r = {0};
+ r.varobj = tmp;
r.changed = 1;
r.value_installed = 1;
VEC_safe_push (varobj_update_result, stack, &r);
@@ -1825,7 +1829,8 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
varobj_p tmp = VEC_index (varobj_p, unchanged, i);
if (!tmp->frozen)
{
- varobj_update_result r = {tmp};
+ varobj_update_result r = {0};
+ r.varobj = tmp;
r.value_installed = 1;
VEC_safe_push (varobj_update_result, stack, &r);
}
@@ -1852,7 +1857,8 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
/* Child may be NULL if explicitly deleted by -var-delete. */
if (c != NULL && !c->frozen)
{
- varobj_update_result r = {c};
+ varobj_update_result r = {0};
+ r.varobj = c;
VEC_safe_push (varobj_update_result, stack, &r);
}
}