From: Nick Roberts Date: Tue, 27 Feb 2007 22:00:39 +0000 (+0000) Subject: (varobj_update): Remove unused local. Use gdb_assert X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1f42e84b8ba21b9cbdc58b9a3a5427137881af3;p=binutils-gdb.git (varobj_update): Remove unused local. Use gdb_assert to check changelist is non-NULL. Call error if the frontend tries to update a non-root variable. --- diff --git a/gdb/varobj.c b/gdb/varobj.c index a2fd1c8bbd3..f86082eca5e 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1037,7 +1037,6 @@ int varobj_update (struct varobj **varp, struct varobj ***changelist) { int changed = 0; - int error = 0; int type_changed; int i; int vleft; @@ -1051,13 +1050,10 @@ varobj_update (struct varobj **varp, struct varobj ***changelist) struct frame_info *fi; /* sanity check: have we been passed a pointer? */ - if (changelist == NULL) - return WRONG_PARAM; + gdb_assert (changelist); - /* Only root variables can be updated... */ if (!is_root_p (*varp)) - /* Not a root var. */ - return WRONG_PARAM; + error (_("Only root variables can be updated")); if (!(*varp)->root->is_valid) return INVALID;