summaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-08-10 14:42:22 -0600
committerTom Tromey <tom@tromey.com>2022-12-19 07:47:37 -0700
commit975249ff4e260453217f4a98b1033b0c7a6e6dc5 (patch)
treebee0f6f082ee6dc4c277683b1bbde7800b9e2a4d /gdb/mi
parentd1c34a1b4c4ee82744f7f8215b23706c329b63e6 (diff)
downloadbinutils-gdb-975249ff4e260453217f4a98b1033b0c7a6e6dc5.tar.gz
Remove MI version 1
MI version 1 is long since obsolete. Several years ago, I filed PR mi/23170 for this. I think it's finally time to remove this. Any users of MI 1 can and should upgrade to a newer version. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23170
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-env.c24
-rw-r--r--gdb/mi/mi-cmd-var.c24
-rw-r--r--gdb/mi/mi-interp.c1
-rw-r--r--gdb/mi/mi-main.c1
-rw-r--r--gdb/mi/mi-out.c3
5 files changed, 3 insertions, 50 deletions
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index 0c75b8042ff..5b077979352 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -65,14 +65,6 @@ mi_cmd_env_pwd (const char *command, char **argv, int argc)
if (argc > 0)
error (_("-environment-pwd: No arguments allowed"));
- if (mi_version (uiout) < 2)
- {
- env_execute_cli_command ("pwd", NULL);
- return;
- }
-
- /* Otherwise the mi level is 2 or higher. */
-
gdb::unique_xmalloc_ptr<char> cwd (getcwd (NULL, 0));
if (cwd == NULL)
error (_("-environment-pwd: error finding name of working directory: %s"),
@@ -126,14 +118,6 @@ mi_cmd_env_path (const char *command, char **argv, int argc)
dont_repeat ();
- if (mi_version (uiout) < 2)
- {
- for (i = argc - 1; i >= 0; --i)
- env_execute_cli_command ("path", argv[i]);
- return;
- }
-
- /* Otherwise the mi level is 2 or higher. */
while (1)
{
int opt = mi_getopt ("-environment-path", argc, argv, opts,
@@ -199,14 +183,6 @@ mi_cmd_env_dir (const char *command, char **argv, int argc)
dont_repeat ();
- if (mi_version (uiout) < 2)
- {
- for (i = argc - 1; i >= 0; --i)
- env_execute_cli_command ("dir", argv[i]);
- return;
- }
-
- /* Otherwise mi level is 2 or higher. */
while (1)
{
int opt = mi_getopt ("-environment-directory", argc, argv, opts,
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 3db09cf7815..e05866657e3 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -390,15 +390,7 @@ mi_cmd_var_list_children (const char *command, char **argv, int argc)
if (from < to)
{
- /* For historical reasons this might emit a list or a tuple, so
- we construct one or the other. */
- gdb::optional<ui_out_emit_tuple> tuple_emitter;
- gdb::optional<ui_out_emit_list> list_emitter;
-
- if (mi_version (uiout) == 1)
- tuple_emitter.emplace (uiout, "children");
- else
- list_emitter.emplace (uiout, "children");
+ ui_out_emit_list list_emitter (uiout, "children");
for (int ix = from; ix < to && ix < children.size (); ix++)
{
ui_out_emit_tuple child_emitter (uiout, "child");
@@ -633,15 +625,7 @@ mi_cmd_var_update (const char *command, char **argv, int argc)
else
print_values = PRINT_NO_VALUES;
- /* For historical reasons this might emit a list or a tuple, so we
- construct one or the other. */
- gdb::optional<ui_out_emit_tuple> tuple_emitter;
- gdb::optional<ui_out_emit_list> list_emitter;
-
- if (mi_version (uiout) <= 1)
- tuple_emitter.emplace (uiout, "changelist");
- else
- list_emitter.emplace (uiout, "changelist");
+ ui_out_emit_list list_emitter (uiout, "changelist");
/* Check if the parameter is a "*", which means that we want to
update all variables. */
@@ -680,9 +664,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
{
int from, to;
- gdb::optional<ui_out_emit_tuple> tuple_emitter;
- if (mi_version (uiout) > 1)
- tuple_emitter.emplace (uiout, nullptr);
+ ui_out_emit_tuple tuple_emitter (uiout, nullptr);
uiout->field_string ("name", varobj_get_objname (r.varobj));
switch (r.status)
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 3cc2462f672..cd6d1a803b4 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -1317,7 +1317,6 @@ void
_initialize_mi_interp ()
{
/* The various interpreter levels. */
- interp_factory_register (INTERP_MI1, mi_interp_factory);
interp_factory_register (INTERP_MI2, mi_interp_factory);
interp_factory_register (INTERP_MI3, mi_interp_factory);
interp_factory_register (INTERP_MI4, mi_interp_factory);
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index e5b003ec99b..1b9948c1f6d 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1856,7 +1856,6 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
/* If we changed interpreters, DON'T print out anything. */
if (current_interp_named_p (INTERP_MI)
- || current_interp_named_p (INTERP_MI1)
|| current_interp_named_p (INTERP_MI2)
|| current_interp_named_p (INTERP_MI3)
|| current_interp_named_p (INTERP_MI4))
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 725c1c68546..b103aac206b 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -348,9 +348,6 @@ mi_out_new (const char *mi_version)
if (streq (mi_version, INTERP_MI2))
return new mi_ui_out (2);
- if (streq (mi_version, INTERP_MI1))
- return new mi_ui_out (1);
-
return nullptr;
}