diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-07-07 09:26:13 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-07-07 09:26:13 +0000 |
commit | fd115a4b71c8d9f4315641b00f00acdb5c6ae4a0 (patch) | |
tree | 2a09a96faca9731f64713867d5ce29fb1a4da688 /gdb | |
parent | 187c4a2b7be39d56d38008039f2284715e3580a9 (diff) | |
download | gdb-fd115a4b71c8d9f4315641b00f00acdb5c6ae4a0.zip gdb-fd115a4b71c8d9f4315641b00f00acdb5c6ae4a0.tar.gz gdb-fd115a4b71c8d9f4315641b00f00acdb5c6ae4a0.tar.bz2 |
gdb/
* 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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/mi/mi-cmd-var.c | 4 | ||||
-rw-r--r-- | gdb/varobj.c | 9 |
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); |