aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mi/mi-cmd-var.c4
-rw-r--r--gdb/varobj.c9
3 files changed, 8 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d3d25d8..a5aa4b9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * mi/mi-cmd-var.c (mi_cmd_var_update): Replace a while loop by for loop.
+ * varobj.c (varobj_invalidate): Replace a while loop by for loop.
+
2009-07-07 Vladimir Prus <vladimir@codesourcery.com>
Fix hang in floating varobjs.
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 64a36bf..a7fea36 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -606,8 +606,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
do_cleanups (cleanup);
return;
}
- cr = rootlist;
- while (*cr != NULL)
+ for (cr = rootlist; *cr != NULL; cr++)
{
int thread_id = varobj_get_thread_id (*cr);
int thread_stopped = 0;
@@ -624,7 +623,6 @@ mi_cmd_var_update (char *command, char **argv, int argc)
if (thread_stopped)
if (*name == '*' || varobj_floating_p (*cr))
varobj_update_one (*cr, print_values, 0 /* implicit */);
- cr++;
}
do_cleanups (cleanup);
}
diff --git a/gdb/varobj.c b/gdb/varobj.c
index e846362..dac0413 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -3225,16 +3225,13 @@ varobj_invalidate (void)
if (varobj_list (&all_rootvarobj) > 0)
{
- varp = all_rootvarobj;
- while (*varp != NULL)
+ for (varp = all_rootvarobj; *varp != NULL; varp++)
{
/* Floating varobjs are reparsed on each stop, so we don't care if
the presently parsed expression refers to something that's gone.
*/
- if ((*varp)->root->floating) {
- varp++;
+ if ((*varp)->root->floating)
continue;
- }
/* global var must be re-evaluated. */
if ((*varp)->root->valid_block == NULL)
@@ -3256,8 +3253,6 @@ varobj_invalidate (void)
}
else /* locals must be invalidated. */
(*varp)->root->is_valid = 0;
-
- varp++;
}
}
xfree (all_rootvarobj);