aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorJan Vrany <jan.vrany@labware.com>2021-11-08 10:46:07 +0000
committerAndrew Burgess <aburgess@redhat.com>2021-12-14 10:34:58 +0000
commit3524a83e5950576a807134dde6c180211219e655 (patch)
tree1b24cc6bf5d45c3b320d1a21f61c58b678a0a08f /gdb/mi
parentfdb2b35b8fdbd5a6c136db326c73582dbfb335f8 (diff)
downloadfsf-binutils-gdb-3524a83e5950576a807134dde6c180211219e655.zip
fsf-binutils-gdb-3524a83e5950576a807134dde6c180211219e655.tar.gz
fsf-binutils-gdb-3524a83e5950576a807134dde6c180211219e655.tar.bz2
gdb/mi: rename mi_lookup to mi_cmd_lookup
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.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-info.c2
-rw-r--r--gdb/mi/mi-cmds.c5
-rw-r--r--gdb/mi/mi-cmds.h5
-rw-r--r--gdb/mi/mi-parse.c2
4 files changed, 8 insertions, 6 deletions
diff --git a/gdb/mi/mi-cmd-info.c b/gdb/mi/mi-cmd-info.c
index 78377dc..c285851 100644
--- a/gdb/mi/mi-cmd-info.c
+++ b/gdb/mi/mi-cmd-info.c
@@ -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");
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 1ed8b6f..8899fdd 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -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);
}
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 8da2e39..e92737b 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -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;
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 4d6afa9..b5b01cf 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -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);