[PATCH 5/5] gdb/mi: rename mi_cmd to mi_command

Andrew Burgess aburgess@redhat.com
Mon Nov 8 17:26:23 GMT 2021


From: Jan Vrany <jan.vrany@labware.com>

Just give this base class a new name, more inline with the name of the
sub-classes.

There should be no user visible changes after this commit.
---
 gdb/mi/mi-cmd-info.c |  2 +-
 gdb/mi/mi-cmds.c     | 18 +++++++++---------
 gdb/mi/mi-cmds.h     |  8 ++++----
 gdb/mi/mi-parse.h    |  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/gdb/mi/mi-cmd-info.c b/gdb/mi/mi-cmd-info.c
index c2858519a4c..3bfd5918ce9 100644
--- a/gdb/mi/mi-cmd-info.c
+++ b/gdb/mi/mi-cmd-info.c
@@ -67,7 +67,7 @@ void
 mi_cmd_info_gdb_mi_command (const char *command, char **argv, int argc)
 {
   const char *cmd_name;
-  struct mi_cmd *cmd;
+  mi_command *cmd;
   struct ui_out *uiout = current_uiout;
 
   /* This command takes exactly one argument.  */
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 75d07dfe20f..2c9f7a1d651 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -28,7 +28,7 @@
 
 /* A command held in the MI_CMD_TABLE.  */
 
-typedef std::unique_ptr<struct mi_cmd> mi_cmd_up;
+typedef std::unique_ptr<struct mi_command> mi_cmd_up;
 
 /* MI command table (built at run time). */
 
@@ -36,12 +36,12 @@ static std::map<std::string, mi_cmd_up> mi_cmd_table;
 
 /* MI command with a pure MI implementation.  */
 
-struct mi_command_mi : public mi_cmd
+struct mi_command_mi : public mi_command
 {
   /* Constructor.  */
   mi_command_mi (const char *name, mi_cmd_argv_ftype func,
                  int *suppress_notification)
-    : mi_cmd (name, suppress_notification),
+    : mi_command (name, suppress_notification),
       m_argv_function (func)
   {
     gdb_assert (func != nullptr);
@@ -65,13 +65,13 @@ struct mi_command_mi : public mi_cmd
 
 /* MI command implemented on top of a CLI command.  */
 
-class mi_command_cli : public mi_cmd
+class mi_command_cli : public mi_command
 {
 public:
   /* Constructor.  */
   mi_command_cli (const char *name, const char *cli_name, bool args_p,
                   int *suppress_notification)
-    : mi_cmd (name, suppress_notification),
+    : mi_command (name, suppress_notification),
       m_cli_name (cli_name),
       m_args_p (args_p)
   { /* Nothing.  */ }
@@ -139,7 +139,7 @@ add_mi_cmd_cli (const char *name, const char *cli_name, int args_p,
 
 /* See mi-cmds.h.  */
 
-mi_cmd::mi_cmd (const char *name, int *suppress_notification)
+mi_command::mi_command (const char *name, int *suppress_notification)
   : m_name (name),
     m_suppress_notification (suppress_notification)
 { /* Nothing.  */ }
@@ -147,7 +147,7 @@ mi_cmd::mi_cmd (const char *name, int *suppress_notification)
 /* See mi-cmds.h.  */
 
 void
-mi_cmd::invoke (struct mi_parse *parse) const
+mi_command::invoke (struct mi_parse *parse) const
 {
   gdb::optional<scoped_restore_tmpl<int>> restore
     = do_suppress_notification ();
@@ -157,7 +157,7 @@ mi_cmd::invoke (struct mi_parse *parse) const
 /* See mi-cmds.h.  */
 
 gdb::optional<scoped_restore_tmpl<int>>
-mi_cmd::do_suppress_notification () const
+mi_command::do_suppress_notification () const
 {
   if (m_suppress_notification != nullptr)
     return scoped_restore_tmpl<int> (m_suppress_notification, 1);
@@ -331,7 +331,7 @@ build_table ()
 
 /* See mi-cmds.h.  */
 
-mi_cmd *
+mi_command *
 mi_cmd_lookup (const char *command)
 {
   gdb_assert (command != nullptr);
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 77982f4d491..c016eb2f2b2 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -140,13 +140,13 @@ extern mi_cmd_argv_ftype mi_cmd_complete;
 
 /* The virtual base class for all MI commands.  */
 
-struct mi_cmd
+struct mi_command
 {
   /* Constructor.  */
-  mi_cmd (const char *name, int *suppress_notification);
+  mi_command (const char *name, int *suppress_notification);
 
   /* Destructor.  */
-  virtual ~mi_cmd () { /* Nothing.  */ };
+  virtual ~mi_command () { /* Nothing.  */ };
 
   /* Return the name of this command.  This is the command that the user
      will actually type in, without any arguments.  */
@@ -184,7 +184,7 @@ struct mi_cmd
 /* Lookup a command in the MI command table, returns nullptr if COMMAND is
    not found.  */
 
-extern mi_cmd *mi_cmd_lookup (const char *command);
+extern mi_command *mi_cmd_lookup (const char *command);
 
 /* Debug flag */
 extern int mi_debug_p;
diff --git a/gdb/mi/mi-parse.h b/gdb/mi/mi-parse.h
index 1d5cc764f00..4c51559a661 100644
--- a/gdb/mi/mi-parse.h
+++ b/gdb/mi/mi-parse.h
@@ -49,7 +49,7 @@ struct mi_parse
     enum mi_command_type op;
     char *command;
     char *token;
-    const struct mi_cmd *cmd;
+    const struct mi_command *cmd;
     struct mi_timestamp *cmd_start;
     char *args;
     char **argv;
-- 
2.25.4



More information about the Gdb-patches mailing list