From: Pedro Alves Date: Tue, 23 Feb 2010 17:01:54 +0000 (+0000) Subject: 2010-02-23 Harald Koenig X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cfce2ea2f1d31e7a2efe7c4b5e93fcd35c994d17;p=binutils-gdb.git 2010-02-23 Harald Koenig * varobj.c (varobj_update): Avoid non-constants in initializers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d5fd34e3012..4abb6af8ccb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-02-23 Harald Koenig + + * varobj.c (varobj_update): Avoid non-constants in initializers. + 2010-02-23 Tom Tromey * dwarf2loc.c (read_pieced_value) : Correctly diff --git a/gdb/varobj.c b/gdb/varobj.c index 6ec87b34333..b4b2461017e 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); } }