/* A command held in the MI_CMD_TABLE. */
-using mi_cmd_up = std::unique_ptr<struct mi_cmd>;
+using mi_command_up = std::unique_ptr<struct mi_command>;
/* MI command table (built at run time). */
-static std::map<std::string, mi_cmd_up> mi_cmd_table;
+static std::map<std::string, mi_command_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. For NAME and SUPPRESS_NOTIFICATION see mi_cmd
+ /* Constructor. For NAME and SUPPRESS_NOTIFICATION see mi_command
constructor, FUNC is the function called from do_invoke, which
implements this MI command. */
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);
/* MI command implemented on top of a CLI command. */
-struct mi_command_cli : public mi_cmd
+struct mi_command_cli : public mi_command
{
- /* Constructor. For NAME and SUPPRESS_NOTIFICATION see mi_cmd
+ /* Constructor. For NAME and SUPPRESS_NOTIFICATION see mi_command
constructor, CLI_NAME is the name of a CLI command that should be
invoked to implement this MI command. If ARGS_P is true then any
arguments from entered by the user as part of the MI command line are
false, nullptr is send to CLI_NAME as its argument string. */
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. */ }
COMMAND was added to mi_cmd_table. */
static bool
-insert_mi_cmd_entry (mi_cmd_up command)
+insert_mi_cmd_entry (mi_command_up command)
{
gdb_assert (command != nullptr);
add_mi_cmd_mi (const char *name, mi_cmd_argv_ftype function,
int *suppress_notification = nullptr)
{
- mi_cmd_up command (new mi_command_mi (name, function,
- suppress_notification));
+ mi_command_up command (new mi_command_mi (name, function,
+ suppress_notification));
bool success = insert_mi_cmd_entry (std::move (command));
gdb_assert (success);
add_mi_cmd_cli (const char *name, const char *cli_name, int args_p,
int *suppress_notification = nullptr)
{
- mi_cmd_up command (new mi_command_cli (name, cli_name, args_p != 0,
- suppress_notification));
+ mi_command_up command (new mi_command_cli (name, cli_name, args_p != 0,
+ suppress_notification));
bool success = insert_mi_cmd_entry (std::move (command));
gdb_assert (success);
/* 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)
{
/* 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 ();
/* 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);
/* See mi-cmds.h. */
-struct mi_cmd *
+mi_command *
mi_cmd_lookup (const char *command)
{
gdb_assert (command != nullptr);
/* The abstract base class for all MI command types. */
-struct mi_cmd
+struct mi_command
{
/* Constructor. NAME is the name of this MI command, excluding any
leading dash, that is the initial string the user will enter to run
this command. The SUPPRESS_NOTIFICATION pointer is a flag which will
be set to 1 when this command is invoked, and reset to its previous
value once the command invocation has completed. */
- mi_cmd (const char *name, int *suppress_notification);
+ mi_command (const char *name, int *suppress_notification);
/* Destructor. */
- virtual ~mi_cmd () = default;
+ virtual ~mi_command () = default;
/* Return the name of this command. This is the command that the user
will actually type in, without any arguments, and without the leading
/* 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;