forked from Imagelibrary/binutils-gdb
Change mi_parse_argv to a method
This changes mi_parse_argv to be a method of mi_parse. This is just a minor cleanup.
This commit is contained in:
@@ -49,7 +49,7 @@ struct mi_command_mi : public mi_command
|
|||||||
with arguments contained within PARSE. */
|
with arguments contained within PARSE. */
|
||||||
void invoke (struct mi_parse *parse) const override
|
void invoke (struct mi_parse *parse) const override
|
||||||
{
|
{
|
||||||
mi_parse_argv (parse->args (), parse);
|
parse->parse_argv ();
|
||||||
|
|
||||||
if (parse->argv == nullptr)
|
if (parse->argv == nullptr)
|
||||||
error (_("Problem parsing arguments: %s %s"), parse->command,
|
error (_("Problem parsing arguments: %s %s"), parse->command,
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ mi_parse_escape (const char **string_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mi_parse_argv (const char *args, struct mi_parse *parse)
|
mi_parse::parse_argv ()
|
||||||
{
|
{
|
||||||
const char *chp = args;
|
const char *chp = m_args.get ();
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
char **argv = XNEWVEC (char *, argc + 1);
|
char **argv = XNEWVEC (char *, argc + 1);
|
||||||
|
|
||||||
@@ -124,8 +124,8 @@ mi_parse_argv (const char *args, struct mi_parse *parse)
|
|||||||
switch (*chp)
|
switch (*chp)
|
||||||
{
|
{
|
||||||
case '\0':
|
case '\0':
|
||||||
parse->argv = argv;
|
this->argv = argv;
|
||||||
parse->argc = argc;
|
this->argc = argc;
|
||||||
return;
|
return;
|
||||||
case '"':
|
case '"':
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ struct mi_parse
|
|||||||
|
|
||||||
DISABLE_COPY_AND_ASSIGN (mi_parse);
|
DISABLE_COPY_AND_ASSIGN (mi_parse);
|
||||||
|
|
||||||
|
/* Split the arguments into argc/argv and store the result. */
|
||||||
|
void parse_argv ();
|
||||||
|
|
||||||
/* Return the full argument string, as used by commands which are
|
/* Return the full argument string, as used by commands which are
|
||||||
implemented as CLI commands. */
|
implemented as CLI commands. */
|
||||||
const char *args () const
|
const char *args () const
|
||||||
@@ -90,8 +93,4 @@ extern std::unique_ptr<struct mi_parse> mi_parse (const char *cmd,
|
|||||||
|
|
||||||
enum print_values mi_parse_print_values (const char *name);
|
enum print_values mi_parse_print_values (const char *name);
|
||||||
|
|
||||||
/* Split ARGS into argc/argv and store the result in PARSE. */
|
|
||||||
|
|
||||||
extern void mi_parse_argv (const char *args, struct mi_parse *parse);
|
|
||||||
|
|
||||||
#endif /* MI_MI_PARSE_H */
|
#endif /* MI_MI_PARSE_H */
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ mi_command_py::invoke (struct mi_parse *parse) const
|
|||||||
|
|
||||||
pymicmd_debug_printf ("this = %p, name = %s", this, name ());
|
pymicmd_debug_printf ("this = %p, name = %s", this, name ());
|
||||||
|
|
||||||
mi_parse_argv (parse->args (), parse);
|
parse->parse_argv ();
|
||||||
|
|
||||||
if (parse->argv == nullptr)
|
if (parse->argv == nullptr)
|
||||||
error (_("Problem parsing arguments: %s %s"), parse->command,
|
error (_("Problem parsing arguments: %s %s"), parse->command,
|
||||||
|
|||||||
Reference in New Issue
Block a user