mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 13:56:22 +08:00
gdb/
Tidy up the code. * mi/mi-cmd-var.c (mi_cmd_var_update): Remove variable nv. Move variables var, rootlist and cr to their local sub-block. Move the make_cleanup_ui_out_tuple_begin_end, make_cleanup_ui_out_list_begin_end and do_cleanups calls to the common base block. Remove the zero NV check.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2009-07-10 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Tidy up the code.
|
||||||
|
* mi/mi-cmd-var.c (mi_cmd_var_update): Remove variable nv. Move
|
||||||
|
variables var, rootlist and cr to their local sub-block. Move the
|
||||||
|
make_cleanup_ui_out_tuple_begin_end, make_cleanup_ui_out_list_begin_end
|
||||||
|
and do_cleanups calls to the common base block. Remove the zero NV
|
||||||
|
check.
|
||||||
|
|
||||||
2009-07-10 Phil Muldoon <pmuldoon@redhat.com>
|
2009-07-10 Phil Muldoon <pmuldoon@redhat.com>
|
||||||
|
|
||||||
* python/python-internal.h (apply_varobj_pretty_printer): Update
|
* python/python-internal.h (apply_varobj_pretty_printer): Update
|
||||||
|
@ -569,12 +569,8 @@ mi_cmd_var_assign (char *command, char **argv, int argc)
|
|||||||
void
|
void
|
||||||
mi_cmd_var_update (char *command, char **argv, int argc)
|
mi_cmd_var_update (char *command, char **argv, int argc)
|
||||||
{
|
{
|
||||||
struct varobj *var;
|
|
||||||
struct varobj **rootlist;
|
|
||||||
struct varobj **cr;
|
|
||||||
struct cleanup *cleanup;
|
struct cleanup *cleanup;
|
||||||
char *name;
|
char *name;
|
||||||
int nv;
|
|
||||||
enum print_values print_values;
|
enum print_values print_values;
|
||||||
|
|
||||||
if (argc != 1 && argc != 2)
|
if (argc != 1 && argc != 2)
|
||||||
@ -590,26 +586,26 @@ mi_cmd_var_update (char *command, char **argv, int argc)
|
|||||||
else
|
else
|
||||||
print_values = PRINT_NO_VALUES;
|
print_values = PRINT_NO_VALUES;
|
||||||
|
|
||||||
|
if (mi_version (uiout) <= 1)
|
||||||
|
cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
|
||||||
|
else
|
||||||
|
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
|
||||||
|
|
||||||
/* Check if the parameter is a "*" which means that we want
|
/* Check if the parameter is a "*" which means that we want
|
||||||
to update all variables */
|
to update all variables */
|
||||||
|
|
||||||
if ((*name == '*' || *name == '@') && (*(name + 1) == '\0'))
|
if ((*name == '*' || *name == '@') && (*(name + 1) == '\0'))
|
||||||
{
|
{
|
||||||
nv = varobj_list (&rootlist);
|
struct varobj **rootlist, **cr;
|
||||||
cleanup = make_cleanup (xfree, rootlist);
|
|
||||||
if (mi_version (uiout) <= 1)
|
varobj_list (&rootlist);
|
||||||
make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
|
make_cleanup (xfree, rootlist);
|
||||||
else
|
|
||||||
make_cleanup_ui_out_list_begin_end (uiout, "changelist");
|
|
||||||
if (nv <= 0)
|
|
||||||
{
|
|
||||||
do_cleanups (cleanup);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (cr = rootlist; *cr != NULL; cr++)
|
for (cr = rootlist; *cr != NULL; cr++)
|
||||||
{
|
{
|
||||||
int thread_id = varobj_get_thread_id (*cr);
|
int thread_id = varobj_get_thread_id (*cr);
|
||||||
int thread_stopped = 0;
|
int thread_stopped = 0;
|
||||||
|
|
||||||
if (thread_id == -1 && is_stopped (inferior_ptid))
|
if (thread_id == -1 && is_stopped (inferior_ptid))
|
||||||
thread_stopped = 1;
|
thread_stopped = 1;
|
||||||
else
|
else
|
||||||
@ -620,24 +616,21 @@ mi_cmd_var_update (char *command, char **argv, int argc)
|
|||||||
else
|
else
|
||||||
thread_stopped = 1;
|
thread_stopped = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thread_stopped)
|
if (thread_stopped)
|
||||||
if (*name == '*' || varobj_floating_p (*cr))
|
if (*name == '*' || varobj_floating_p (*cr))
|
||||||
varobj_update_one (*cr, print_values, 0 /* implicit */);
|
varobj_update_one (*cr, print_values, 0 /* implicit */);
|
||||||
}
|
}
|
||||||
do_cleanups (cleanup);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Get varobj handle, if a valid var obj name was specified */
|
/* Get varobj handle, if a valid var obj name was specified */
|
||||||
var = varobj_get_handle (name);
|
struct varobj *var = varobj_get_handle (name);
|
||||||
|
|
||||||
if (mi_version (uiout) <= 1)
|
|
||||||
cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
|
|
||||||
else
|
|
||||||
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
|
|
||||||
varobj_update_one (var, print_values, 1 /* explicit */);
|
varobj_update_one (var, print_values, 1 /* explicit */);
|
||||||
do_cleanups (cleanup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_cleanups (cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper for mi_cmd_var_update(). */
|
/* Helper for mi_cmd_var_update(). */
|
||||||
|
Reference in New Issue
Block a user