diff options
author | Tom Tromey <tom@tromey.com> | 2020-12-11 09:33:36 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-12-11 09:33:37 -0700 |
commit | d8f168ddd08f1d5fde1a193724cdc40d524039a7 (patch) | |
tree | 5f6679f48c8d8d0d2c0e4ae44bf61f2d0a7c9e32 /gdb/mi/mi-cmd-var.c | |
parent | 76deb5d9181416cb7ea68764db13e7059d48a46c (diff) | |
download | gdb-d8f168ddd08f1d5fde1a193724cdc40d524039a7.zip gdb-d8f168ddd08f1d5fde1a193724cdc40d524039a7.tar.gz gdb-d8f168ddd08f1d5fde1a193724cdc40d524039a7.tar.bz2 |
Change all_root_varobjs to take a function_view
This changes all_root_varobjs to take a function_view. This
simplifies some of the callers, in particular we can remove a data
type that only existed to be passed through.
gdb/ChangeLog
2020-12-11 Tom Tromey <tom@tromey.com>
* varobj.h (all_root_varobjs): Take a function_view.
* varobj.c (all_root_varobjs): Take a function_view.
(varobj_invalidate_iter): Remove unused parameter.
(varobj_invalidate): Update.
* mi/mi-cmd-var.c (struct mi_cmd_var_update): Remove.
(mi_cmd_var_update_iter): Change parameters.
Diffstat (limited to 'gdb/mi/mi-cmd-var.c')
-rw-r--r-- | gdb/mi/mi-cmd-var.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 178eeec..752d89a 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -585,20 +585,12 @@ mi_cmd_var_assign (const char *command, char **argv, int argc) uiout->field_string ("value", val.c_str ()); } -/* Type used for parameters passing to mi_cmd_var_update_iter. */ - -struct mi_cmd_var_update - { - int only_floating; - enum print_values print_values; - }; - /* Helper for mi_cmd_var_update - update each VAR. */ static void -mi_cmd_var_update_iter (struct varobj *var, void *data_pointer) +mi_cmd_var_update_iter (struct varobj *var, bool only_floating, + enum print_values print_values) { - struct mi_cmd_var_update *data = (struct mi_cmd_var_update *) data_pointer; bool thread_stopped; int thread_id = varobj_get_thread_id (var); @@ -617,8 +609,8 @@ mi_cmd_var_update_iter (struct varobj *var, void *data_pointer) } if (thread_stopped - && (!data->only_floating || varobj_floating_p (var))) - varobj_update_one (var, data->print_values, false /* implicit */); + && (!only_floating || varobj_floating_p (var))) + varobj_update_one (var, print_values, false /* implicit */); } void @@ -656,16 +648,14 @@ mi_cmd_var_update (const char *command, char **argv, int argc) if ((*name == '*' || *name == '@') && (*(name + 1) == '\0')) { - struct mi_cmd_var_update data; - - data.only_floating = (*name == '@'); - data.print_values = print_values; - /* varobj_update_one automatically updates all the children of VAROBJ. Therefore update each VAROBJ only once by iterating only the root VAROBJs. */ - all_root_varobjs (mi_cmd_var_update_iter, &data); + all_root_varobjs ([=] (varobj *var) + { + mi_cmd_var_update_iter (var, *name == '0', print_values); + }); } else { |