aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-var.c44
-rw-r--r--gdb/mi/mi-cmds.c1
-rw-r--r--gdb/mi/mi-cmds.h1
3 files changed, 41 insertions, 5 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 9ae37db..c3801ad 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -37,7 +37,8 @@ const char mi_all_values[] = "--all-values";
extern int varobjdebug; /* defined in varobj.c. */
static void varobj_update_one (struct varobj *var,
- enum print_values print_values);
+ enum print_values print_values,
+ int explicit);
static int mi_print_value_p (struct type *type, enum print_values print_values);
@@ -64,6 +65,9 @@ print_varobj (struct varobj *var, enum print_values print_values,
ui_out_field_string (uiout, "type", type);
xfree (type);
}
+
+ if (varobj_get_frozen (var))
+ ui_out_field_int (uiout, "frozen", 1);
}
/* VAROBJ operations */
@@ -233,6 +237,35 @@ mi_cmd_var_set_format (char *command, char **argv, int argc)
}
enum mi_cmd_result
+mi_cmd_var_set_frozen (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+ int frozen;
+
+ if (argc != 2)
+ error (_("-var-set-format: Usage: NAME FROZEN_FLAG."));
+
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error (_("Variable object not found"));
+
+ if (strcmp (argv[1], "0") == 0)
+ frozen = 0;
+ else if (strcmp (argv[1], "1") == 0)
+ frozen = 1;
+ else
+ error (_("Invalid flag value"));
+
+ varobj_set_frozen (var, frozen);
+
+ /* We don't automatically return the new value, or what varobjs got new
+ values during unfreezing. If this information is required, client
+ should call -var-update explicitly. */
+ return MI_CMD_DONE;
+}
+
+
+enum mi_cmd_result
mi_cmd_var_show_format (char *command, char **argv, int argc)
{
enum varobj_display_formats format;
@@ -513,7 +546,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
cr = rootlist;
while (*cr != NULL)
{
- varobj_update_one (*cr, print_values);
+ varobj_update_one (*cr, print_values, 0 /* implicit */);
cr++;
}
do_cleanups (cleanup);
@@ -529,7 +562,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
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);
+ varobj_update_one (var, print_values, 1 /* explicit */);
do_cleanups (cleanup);
}
return MI_CMD_DONE;
@@ -538,14 +571,15 @@ mi_cmd_var_update (char *command, char **argv, int argc)
/* Helper for mi_cmd_var_update(). */
static void
-varobj_update_one (struct varobj *var, enum print_values print_values)
+varobj_update_one (struct varobj *var, enum print_values print_values,
+ int explicit)
{
struct varobj **changelist;
struct varobj **cc;
struct cleanup *cleanup = NULL;
int nc;
- nc = varobj_update (&var, &changelist);
+ nc = varobj_update (&var, &changelist, explicit);
/* nc >= 0 represents the number of changes reported into changelist.
nc < 0 means that an error occured or the the variable has
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index c891a77..683f1f1 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -156,6 +156,7 @@ struct mi_cmd mi_cmds[] =
{ "var-info-type", { NULL, 0 }, 0, mi_cmd_var_info_type},
{ "var-list-children", { NULL, 0 }, 0, mi_cmd_var_list_children},
{ "var-set-format", { NULL, 0 }, 0, mi_cmd_var_set_format},
+ { "var-set-frozen", { NULL, 0 }, 0, mi_cmd_var_set_frozen},
{ "var-show-attributes", { NULL, 0 }, 0, mi_cmd_var_show_attributes},
{ "var-show-format", { NULL, 0 }, 0, mi_cmd_var_show_format},
{ "var-update", { NULL, 0 }, 0, mi_cmd_var_update},
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index e70b0f0..623181f 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -113,6 +113,7 @@ extern mi_cmd_argv_ftype mi_cmd_var_info_num_children;
extern mi_cmd_argv_ftype mi_cmd_var_info_type;
extern mi_cmd_argv_ftype mi_cmd_var_list_children;
extern mi_cmd_argv_ftype mi_cmd_var_set_format;
+extern mi_cmd_argv_ftype mi_cmd_var_set_frozen;
extern mi_cmd_argv_ftype mi_cmd_var_show_attributes;
extern mi_cmd_argv_ftype mi_cmd_var_show_format;
extern mi_cmd_argv_ftype mi_cmd_var_update;