]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/mi: rename mi_lookup to mi_cmd_lookup
authorJan Vrany <jan.vrany@labware.com>
Mon, 8 Nov 2021 10:46:07 +0000 (10:46 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 14 Dec 2021 10:34:58 +0000 (10:34 +0000)
Lets give this function a more descriptive name.  I've also improved
the comments in the header and source files.

There should be no user visible changes after this commit.

gdb/mi/mi-cmd-info.c
gdb/mi/mi-cmds.c
gdb/mi/mi-cmds.h
gdb/mi/mi-parse.c

index 78377dc32e752262d1395c5abc3388487dcbf2ec..c2858519a4ca4100af9e8770c85d271098cbd2ac 100644 (file)
@@ -82,7 +82,7 @@ mi_cmd_info_gdb_mi_command (const char *command, char **argv, int argc)
   if (cmd_name[0] == '-')
     cmd_name++;
 
-  cmd = mi_lookup (cmd_name);
+  cmd = mi_cmd_lookup (cmd_name);
 
   ui_out_emit_tuple tuple_emitter (uiout, "command");
   uiout->field_string ("exists", cmd != NULL ? "true" : "false");
index 1ed8b6f91262676113820f9dbb94d6d7df8a1049..8899fdd3a1eddcc0842e9dc57ca3515b7ed6e9d6 100644 (file)
@@ -211,9 +211,10 @@ enum
     MI_TABLE_SIZE = 227
   };
 
-/* Exported function used to obtain info from the table.  */
+/* See mi-cmds.h.  */
+
 struct mi_cmd *
-mi_lookup (const char *command)
+mi_cmd_lookup (const char *command)
 {
   return *lookup_table (command);
 }
index 8da2e3939197d8c4e74d531e7acea25fafb4fdea..e92737be8c840261bfa004576b02773d16bbb491 100644 (file)
@@ -164,9 +164,10 @@ struct mi_cmd
   int *suppress_notification;
 };
 
-/* Lookup a command in the MI command table.  */
+/* Lookup a command in the MI command table, returns nullptr if COMMAND is
+   not found.  */
 
-extern struct mi_cmd *mi_lookup (const char *command);
+extern struct mi_cmd *mi_cmd_lookup (const char *command);
 
 /* Debug flag */
 extern int mi_debug_p;
index 4d6afa93e1fa5643842add42560d5eac9e70b87b..b5b01cf4db02974604bfc1c4e4e95467062cf23e 100644 (file)
@@ -272,7 +272,7 @@ mi_parse (const char *cmd, char **token)
   }
 
   /* Find the command in the MI table.  */
-  parse->cmd = mi_lookup (parse->command);
+  parse->cmd = mi_cmd_lookup (parse->command);
   if (parse->cmd == NULL)
     throw_error (UNDEFINED_COMMAND_ERROR,
                 _("Undefined MI command: %s"), parse->command);