Lines Matching refs:cmd
207 static bool cmd_can_preconfig(const HMPCommand *cmd) in cmd_can_preconfig() argument
209 if (!cmd->flags) { in cmd_can_preconfig()
213 return strchr(cmd->flags, 'p'); in cmd_can_preconfig()
216 static bool cmd_available(const HMPCommand *cmd) in cmd_available() argument
218 return phase_check(PHASE_MACHINE_READY) || cmd_can_preconfig(cmd); in cmd_available()
222 const HMPCommand *cmd, in help_cmd_dump_one() argument
228 if (!cmd_available(cmd)) { in help_cmd_dump_one()
235 monitor_printf(mon, "%s %s -- %s\n", cmd->name, cmd->params, cmd->help); in help_cmd_dump_one()
242 const HMPCommand *cmd; in help_cmd_dump() local
247 for (cmd = cmds; cmd->name != NULL; cmd++) { in help_cmd_dump()
248 help_cmd_dump_one(mon, cmd, args, arg_index); in help_cmd_dump()
254 for (cmd = cmds; cmd->name != NULL; cmd++) { in help_cmd_dump()
255 if (hmp_compare_cmd(args[arg_index], cmd->name) && in help_cmd_dump()
256 cmd_available(cmd)) { in help_cmd_dump()
257 if (cmd->sub_table) { in help_cmd_dump()
259 help_cmd_dump(mon, cmd->sub_table, in help_cmd_dump()
262 help_cmd_dump_one(mon, cmd, args, arg_index); in help_cmd_dump()
622 const HMPCommand *cmd; in search_dispatch_table() local
624 for (cmd = disp_table; cmd->name != NULL; cmd++) { in search_dispatch_table()
625 if (hmp_compare_cmd(cmdname, cmd->name)) { in search_dispatch_table()
626 return cmd; in search_dispatch_table()
650 const HMPCommand *cmd; in monitor_parse_command() local
659 cmd = search_dispatch_table(table, cmdname); in monitor_parse_command()
660 if (!cmd) { in monitor_parse_command()
665 if (!cmd_available(cmd)) { in monitor_parse_command()
679 if (cmd->sub_table != NULL && *p != '\0') { in monitor_parse_command()
680 return monitor_parse_command(hmp_mon, cmdp_start, cmdp, cmd->sub_table); in monitor_parse_command()
683 return cmd; in monitor_parse_command()
694 const HMPCommand *cmd) in monitor_parse_arguments() argument
704 typestr = cmd->args_type; in monitor_parse_arguments()
734 cmd->name); in monitor_parse_arguments()
738 cmd->name); in monitor_parse_arguments()
741 monitor_printf(mon, "%s: string expected\n", cmd->name); in monitor_parse_arguments()
890 monitor_printf(mon, "\'%s\' has failed: ", cmd->name); in monitor_parse_arguments()
1002 cmd->name, *p); in monitor_parse_arguments()
1020 cmd->name, *tmp); in monitor_parse_arguments()
1052 cmd->name); in monitor_parse_arguments()
1061 monitor_printf(mon, "%s: unknown type '%c'\n", cmd->name, c); in monitor_parse_arguments()
1073 cmd->name); in monitor_parse_arguments()
1099 const HMPCommand *cmd, in handle_hmp_command_exec() argument
1102 if (cmd->cmd_info_hrt) { in handle_hmp_command_exec()
1104 cmd->cmd_info_hrt); in handle_hmp_command_exec()
1106 cmd->cmd(mon, qdict); in handle_hmp_command_exec()
1112 const HMPCommand *cmd; member
1120 handle_hmp_command_exec(data->mon, data->cmd, data->qdict); in handle_hmp_command_co()
1128 const HMPCommand *cmd; in handle_hmp_command() local
1133 cmd = monitor_parse_command(mon, cmdline, &cmdline, hmp_cmds); in handle_hmp_command()
1134 if (!cmd) { in handle_hmp_command()
1138 if (!cmd->cmd && !cmd->cmd_info_hrt) { in handle_hmp_command()
1145 qdict = monitor_parse_arguments(&mon->common, &cmdline, cmd); in handle_hmp_command()
1155 if (!cmd->coroutine) { in handle_hmp_command()
1158 handle_hmp_command_exec(&mon->common, cmd, qdict); in handle_hmp_command()
1163 .cmd = cmd, in handle_hmp_command()
1179 char cmd[128]; in cmd_completion() local
1187 if (len > sizeof(cmd) - 2) { in cmd_completion()
1188 len = sizeof(cmd) - 2; in cmd_completion()
1190 memcpy(cmd, pstart, len); in cmd_completion()
1191 cmd[len] = '\0'; in cmd_completion()
1192 readline_add_completion_of(mon->rs, name, cmd); in cmd_completion()
1272 const HMPCommand *cmd; in monitor_find_completion_by_table() local
1283 for (cmd = cmd_table; cmd->name != NULL; cmd++) { in monitor_find_completion_by_table()
1284 if (cmd_available(cmd)) { in monitor_find_completion_by_table()
1285 cmd_completion(mon, cmdname, cmd->name); in monitor_find_completion_by_table()
1290 for (cmd = cmd_table; cmd->name != NULL; cmd++) { in monitor_find_completion_by_table()
1291 if (hmp_compare_cmd(args[0], cmd->name) && in monitor_find_completion_by_table()
1292 cmd_available(cmd)) { in monitor_find_completion_by_table()
1296 if (!cmd->name) { in monitor_find_completion_by_table()
1300 if (cmd->sub_table) { in monitor_find_completion_by_table()
1302 monitor_find_completion_by_table(mon, cmd->sub_table, in monitor_find_completion_by_table()
1306 if (cmd->command_completion) { in monitor_find_completion_by_table()
1307 cmd->command_completion(mon->rs, nb_args, args[nb_args - 1]); in monitor_find_completion_by_table()
1311 ptype = next_arg_type(cmd->args_type); in monitor_find_completion_by_table()
1341 if (!strcmp(cmd->name, "help|?")) { in monitor_find_completion_by_table()