diff options
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-decode.c | 110 | ||||
-rw-r--r-- | gdb/cli/cli-decode.h | 2 | ||||
-rw-r--r-- | gdb/cli/cli-script.c | 10 | ||||
-rw-r--r-- | gdb/cli/cli-setshow.c | 20 |
4 files changed, 71 insertions, 71 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 4ec6ec0..2ee2ae0 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -189,7 +189,7 @@ set_cmd_completer_handle_brkchars (struct cmd_list_element *cmd, of *LIST). */ struct cmd_list_element * -add_cmd (const char *name, enum command_class class, cmd_cfunc_ftype *fun, +add_cmd (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list) { struct cmd_list_element *c @@ -228,7 +228,7 @@ add_cmd (const char *name, enum command_class class, cmd_cfunc_ftype *fun, } c->name = name; - c->class = class; + c->theclass = theclass; set_cmd_cfunc (c, fun); set_cmd_context (c, NULL); c->doc = doc; @@ -283,7 +283,7 @@ deprecate_cmd (struct cmd_list_element *cmd, const char *replacement) } struct cmd_list_element * -add_alias_cmd (const char *name, const char *oldname, enum command_class class, +add_alias_cmd (const char *name, const char *oldname, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list) { const char *tmp; @@ -306,7 +306,7 @@ add_alias_cmd (const char *name, const char *oldname, enum command_class class, return 0; } - c = add_cmd (name, class, NULL, old->doc, list); + c = add_cmd (name, theclass, NULL, old->doc, list); /* If OLD->DOC can be freed, we should make another copy. */ if (old->doc_allocated) @@ -335,13 +335,13 @@ add_alias_cmd (const char *name, const char *oldname, enum command_class class, containing that list. */ struct cmd_list_element * -add_prefix_cmd (const char *name, enum command_class class, +add_prefix_cmd (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list) { - struct cmd_list_element *c = add_cmd (name, class, fun, doc, list); + struct cmd_list_element *c = add_cmd (name, theclass, fun, doc, list); struct cmd_list_element *p; c->prefixlist = prefixlist; @@ -363,13 +363,13 @@ add_prefix_cmd (const char *name, enum command_class class, /* Like add_prefix_cmd but sets the abbrev_flag on the new command. */ struct cmd_list_element * -add_abbrev_prefix_cmd (const char *name, enum command_class class, +add_abbrev_prefix_cmd (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list) { - struct cmd_list_element *c = add_cmd (name, class, fun, doc, list); + struct cmd_list_element *c = add_cmd (name, theclass, fun, doc, list); c->prefixlist = prefixlist; c->prefixname = prefixname; @@ -403,13 +403,13 @@ empty_sfunc (char *args, int from_tty, struct cmd_list_element *c) static struct cmd_list_element * add_set_or_show_cmd (const char *name, enum cmd_types type, - enum command_class class, + enum command_class theclass, var_types var_type, void *var, const char *doc, struct cmd_list_element **list) { - struct cmd_list_element *c = add_cmd (name, class, NULL, doc, list); + struct cmd_list_element *c = add_cmd (name, theclass, NULL, doc, list); gdb_assert (type == set_cmd || type == show_cmd); c->type = type; @@ -432,7 +432,7 @@ add_set_or_show_cmd (const char *name, static void add_setshow_cmd_full (const char *name, - enum command_class class, + enum command_class theclass, var_types var_type, void *var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -458,7 +458,7 @@ add_setshow_cmd_full (const char *name, full_set_doc = xstrdup (set_doc); full_show_doc = xstrdup (show_doc); } - set = add_set_or_show_cmd (name, set_cmd, class, var_type, var, + set = add_set_or_show_cmd (name, set_cmd, theclass, var_type, var, full_set_doc, set_list); set->doc_allocated = 1; @@ -467,7 +467,7 @@ add_setshow_cmd_full (const char *name, set_cmd_prefix (set, set_list); - show = add_set_or_show_cmd (name, show_cmd, class, var_type, var, + show = add_set_or_show_cmd (name, show_cmd, theclass, var_type, var, full_show_doc, show_list); show->doc_allocated = 1; show->show_value_func = show_func; @@ -485,7 +485,7 @@ add_setshow_cmd_full (const char *name, void add_setshow_enum_cmd (const char *name, - enum command_class class, + enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, @@ -498,7 +498,7 @@ add_setshow_enum_cmd (const char *name, { struct cmd_list_element *c; - add_setshow_cmd_full (name, class, var_enum, var, + add_setshow_cmd_full (name, theclass, var_enum, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -514,7 +514,7 @@ const char * const auto_boolean_enums[] = { "on", "off", "auto", NULL }; string. FUNC is the corresponding callback. */ void add_setshow_auto_boolean_cmd (const char *name, - enum command_class class, + enum command_class theclass, enum auto_boolean *var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -525,7 +525,7 @@ add_setshow_auto_boolean_cmd (const char *name, { struct cmd_list_element *c; - add_setshow_cmd_full (name, class, var_auto_boolean, var, + add_setshow_cmd_full (name, theclass, var_auto_boolean, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -538,7 +538,7 @@ add_setshow_auto_boolean_cmd (const char *name, add_cmd. VAR is address of the variable which will contain the value. SET_DOC and SHOW_DOC are the documentation strings. */ void -add_setshow_boolean_cmd (const char *name, enum command_class class, int *var, +add_setshow_boolean_cmd (const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, @@ -549,7 +549,7 @@ add_setshow_boolean_cmd (const char *name, enum command_class class, int *var, static const char *boolean_enums[] = { "on", "off", NULL }; struct cmd_list_element *c; - add_setshow_cmd_full (name, class, var_boolean, var, + add_setshow_cmd_full (name, theclass, var_boolean, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -560,7 +560,7 @@ add_setshow_boolean_cmd (const char *name, enum command_class class, int *var, /* Add element named NAME to both the set and show command LISTs (the list for set/show or some sublist thereof). */ void -add_setshow_filename_cmd (const char *name, enum command_class class, +add_setshow_filename_cmd (const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -571,7 +571,7 @@ add_setshow_filename_cmd (const char *name, enum command_class class, { struct cmd_list_element *set_result; - add_setshow_cmd_full (name, class, var_filename, var, + add_setshow_cmd_full (name, theclass, var_filename, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -582,7 +582,7 @@ add_setshow_filename_cmd (const char *name, enum command_class class, /* Add element named NAME to both the set and show command LISTs (the list for set/show or some sublist thereof). */ void -add_setshow_string_cmd (const char *name, enum command_class class, +add_setshow_string_cmd (const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -591,7 +591,7 @@ add_setshow_string_cmd (const char *name, enum command_class class, struct cmd_list_element **set_list, struct cmd_list_element **show_list) { - add_setshow_cmd_full (name, class, var_string, var, + add_setshow_cmd_full (name, theclass, var_string, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -601,7 +601,7 @@ add_setshow_string_cmd (const char *name, enum command_class class, /* Add element named NAME to both the set and show command LISTs (the list for set/show or some sublist thereof). */ struct cmd_list_element * -add_setshow_string_noescape_cmd (const char *name, enum command_class class, +add_setshow_string_noescape_cmd (const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -612,7 +612,7 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class class, { struct cmd_list_element *set_cmd; - add_setshow_cmd_full (name, class, var_string_noescape, var, + add_setshow_cmd_full (name, theclass, var_string_noescape, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -623,7 +623,7 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class class, /* Add element named NAME to both the set and show command LISTs (the list for set/show or some sublist thereof). */ void -add_setshow_optional_filename_cmd (const char *name, enum command_class class, +add_setshow_optional_filename_cmd (const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -634,7 +634,7 @@ add_setshow_optional_filename_cmd (const char *name, enum command_class class, { struct cmd_list_element *set_result; - add_setshow_cmd_full (name, class, var_optional_filename, var, + add_setshow_cmd_full (name, theclass, var_optional_filename, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -666,7 +666,7 @@ integer_unlimited_completer (struct cmd_list_element *ignore, value. SET_DOC and SHOW_DOC are the documentation strings. This function is only used in Python API. Please don't use it elsewhere. */ void -add_setshow_integer_cmd (const char *name, enum command_class class, +add_setshow_integer_cmd (const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -677,7 +677,7 @@ add_setshow_integer_cmd (const char *name, enum command_class class, { struct cmd_list_element *set; - add_setshow_cmd_full (name, class, var_integer, var, + add_setshow_cmd_full (name, theclass, var_integer, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -691,7 +691,7 @@ add_setshow_integer_cmd (const char *name, enum command_class class, add_cmd. VAR is address of the variable which will contain the value. SET_DOC and SHOW_DOC are the documentation strings. */ void -add_setshow_uinteger_cmd (const char *name, enum command_class class, +add_setshow_uinteger_cmd (const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -702,7 +702,7 @@ add_setshow_uinteger_cmd (const char *name, enum command_class class, { struct cmd_list_element *set; - add_setshow_cmd_full (name, class, var_uinteger, var, + add_setshow_cmd_full (name, theclass, var_uinteger, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -716,7 +716,7 @@ add_setshow_uinteger_cmd (const char *name, enum command_class class, add_cmd. VAR is address of the variable which will contain the value. SET_DOC and SHOW_DOC are the documentation strings. */ void -add_setshow_zinteger_cmd (const char *name, enum command_class class, +add_setshow_zinteger_cmd (const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -725,7 +725,7 @@ add_setshow_zinteger_cmd (const char *name, enum command_class class, struct cmd_list_element **set_list, struct cmd_list_element **show_list) { - add_setshow_cmd_full (name, class, var_zinteger, var, + add_setshow_cmd_full (name, theclass, var_zinteger, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -734,7 +734,7 @@ add_setshow_zinteger_cmd (const char *name, enum command_class class, void add_setshow_zuinteger_unlimited_cmd (const char *name, - enum command_class class, + enum command_class theclass, int *var, const char *set_doc, const char *show_doc, @@ -746,7 +746,7 @@ add_setshow_zuinteger_unlimited_cmd (const char *name, { struct cmd_list_element *set; - add_setshow_cmd_full (name, class, var_zuinteger_unlimited, var, + add_setshow_cmd_full (name, theclass, var_zuinteger_unlimited, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -760,7 +760,7 @@ add_setshow_zuinteger_unlimited_cmd (const char *name, add_cmd. VAR is address of the variable which will contain the value. SET_DOC and SHOW_DOC are the documentation strings. */ void -add_setshow_zuinteger_cmd (const char *name, enum command_class class, +add_setshow_zuinteger_cmd (const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, @@ -769,7 +769,7 @@ add_setshow_zuinteger_cmd (const char *name, enum command_class class, struct cmd_list_element **set_list, struct cmd_list_element **show_list) { - add_setshow_cmd_full (name, class, var_zuinteger, var, + add_setshow_cmd_full (name, theclass, var_zuinteger, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, @@ -870,19 +870,19 @@ add_info_alias (const char *name, const char *oldname, int abbrev_flag) /* Add an element to the list of commands. */ struct cmd_list_element * -add_com (const char *name, enum command_class class, cmd_cfunc_ftype *fun, +add_com (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc) { - return add_cmd (name, class, fun, doc, &cmdlist); + return add_cmd (name, theclass, fun, doc, &cmdlist); } /* Add an alias or abbreviation command to the list of commands. */ struct cmd_list_element * -add_com_alias (const char *name, const char *oldname, enum command_class class, +add_com_alias (const char *name, const char *oldname, enum command_class theclass, int abbrev_flag) { - return add_alias_cmd (name, oldname, class, abbrev_flag, &cmdlist); + return add_alias_cmd (name, oldname, theclass, abbrev_flag, &cmdlist); } /* Recursively walk the commandlist structures, and print out the @@ -991,7 +991,7 @@ help_cmd (const char *command, struct ui_file *stream) /* If this is a class name, print all of the commands in the class. */ if (c->func == NULL) - help_list (cmdlist, "", c->class, stream); + help_list (cmdlist, "", c->theclass, stream); if (c->hook_pre || c->hook_post) fprintf_filtered (stream, @@ -1021,7 +1021,7 @@ help_cmd (const char *command, struct ui_file *stream) */ void help_list (struct cmd_list_element *list, const char *cmdtype, - enum command_class class, struct ui_file *stream) + enum command_class theclass, struct ui_file *stream) { int len; char *cmdtype1, *cmdtype2; @@ -1042,14 +1042,14 @@ help_list (struct cmd_list_element *list, const char *cmdtype, strcpy (cmdtype2 + len - 1, " sub"); } - if (class == all_classes) + if (theclass == all_classes) fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2); else fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2); - help_cmd_list (list, class, cmdtype, (int) class >= 0, stream); + help_cmd_list (list, theclass, cmdtype, (int) theclass >= 0, stream); - if (class == all_classes) + if (theclass == all_classes) { fprintf_filtered (stream, "\n\ Type \"help%s\" followed by a class name for a list of commands in ", @@ -1091,7 +1091,7 @@ help_all (struct ui_file *stream) if (c->func == NULL) { fprintf_filtered (stream, "\nCommand class: %s\n\n", c->name); - help_cmd_list (cmdlist, c->class, "", 1, stream); + help_cmd_list (cmdlist, c->theclass, "", 1, stream); } } @@ -1104,7 +1104,7 @@ help_all (struct ui_file *stream) if (c->abbrev_flag) continue; - if (c->class == no_class) + if (c->theclass == no_class) { if (!seen_unclassified) { @@ -1187,7 +1187,7 @@ print_help_for_command (struct cmd_list_element *c, const char *prefix, * is at the low level, not the high-level). */ void -help_cmd_list (struct cmd_list_element *list, enum command_class class, +help_cmd_list (struct cmd_list_element *list, enum command_class theclass, const char *prefix, int recurse, struct ui_file *stream) { struct cmd_list_element *c; @@ -1195,16 +1195,16 @@ help_cmd_list (struct cmd_list_element *list, enum command_class class, for (c = list; c; c = c->next) { if (c->abbrev_flag == 0 - && (class == all_commands - || (class == all_classes && c->func == NULL) - || (class == c->class && c->func != NULL))) + && (theclass == all_commands + || (theclass == all_classes && c->func == NULL) + || (theclass == c->theclass && c->func != NULL))) { print_help_for_command (c, prefix, recurse, stream); } else if (c->abbrev_flag == 0 && recurse - && class == class_user && c->prefixlist != NULL) + && theclass == class_user && c->prefixlist != NULL) /* User-defined commands may be subcommands. */ - help_cmd_list (*c->prefixlist, class, c->prefixname, + help_cmd_list (*c->prefixlist, theclass, c->prefixname, recurse, stream); } } @@ -1898,6 +1898,6 @@ cmd_func (struct cmd_list_element *cmd, char *args, int from_tty) int cli_user_command_p (struct cmd_list_element *cmd) { - return (cmd->class == class_user + return (cmd->theclass == class_user && (cmd->func == do_cfunc || cmd->func == do_sfunc)); } diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h index ec89325..a669ba6 100644 --- a/gdb/cli/cli-decode.h +++ b/gdb/cli/cli-decode.h @@ -53,7 +53,7 @@ struct cmd_list_element const char *name; /* Command class; class values are chosen by application program. */ - enum command_class class; + enum command_class theclass; /* When 1 indicated that this command is deprecated. It may be removed from gdb's command set in the future. */ diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 2989b05..65232da 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1532,7 +1532,7 @@ define_command (char *comname, int from_tty) { int q; - if (c->class == class_user || c->class == class_alias) + if (c->theclass == class_user || c->theclass == class_alias) q = query (_("Redefine command \"%s\"? "), c->name); else q = query (_("Really redefine built-in command \"%s\"? "), c->name); @@ -1584,11 +1584,11 @@ define_command (char *comname, int from_tty) "Type commands for definition of \"%s\".", comfull); cmds = read_command_lines (tmpbuf, from_tty, 1, 0, 0); - if (c && c->class == class_user) + if (c && c->theclass == class_user) free_command_lines (&c->user_commands); newc = add_cmd (comname, class_user, user_defined_command, - (c && c->class == class_user) + (c && c->theclass == class_user) ? c->doc : xstrdup ("User-defined."), list); newc->user_commands = cmds; @@ -1629,7 +1629,7 @@ document_command (char *comname, int from_tty) tem = comname; c = lookup_cmd (&tem, *list, "", 0, 1); - if (c->class != class_user) + if (c->theclass != class_user) error (_("Command \"%s\" is built-in."), comfull); xsnprintf (tmpbuf, sizeof (tmpbuf), "Type documentation for \"%s\".", @@ -1739,7 +1739,7 @@ show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name, const char *prefixname = c->prefixname; for (c = *c->prefixlist; c != NULL; c = c->next) - if (c->class == class_user || c->prefixlist != NULL) + if (c->theclass == class_user || c->prefixlist != NULL) show_user_1 (c, prefixname, c->name, gdb_stdout); return; } diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 09bf28d..8d01b52 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -37,8 +37,8 @@ notify_command_param_changed_p (int param_changed, struct cmd_list_element *c) if (param_changed == 0) return 0; - if (c->class == class_maintenance || c->class == class_deprecated - || c->class == class_obscure) + if (c->theclass == class_maintenance || c->theclass == class_deprecated + || c->theclass == class_obscure) return 0; return 1; @@ -158,16 +158,16 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c) { case var_string: { - char *new; + char *newobj; const char *p; char *q; int ch; if (arg == NULL) arg = ""; - new = (char *) xmalloc (strlen (arg) + 2); + newobj = (char *) xmalloc (strlen (arg) + 2); p = arg; - q = new; + q = newobj; while ((ch = *p++) != '\000') { if (ch == '\\') @@ -195,18 +195,18 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c) *q++ = ' '; #endif *q++ = '\0'; - new = (char *) xrealloc (new, q - new); + newobj = (char *) xrealloc (newobj, q - newobj); if (*(char **) c->var == NULL - || strcmp (*(char **) c->var, new) != 0) + || strcmp (*(char **) c->var, newobj) != 0) { xfree (*(char **) c->var); - *(char **) c->var = new; + *(char **) c->var = newobj; option_changed = 1; } else - xfree (new); + xfree (newobj); } break; case var_string_noescape: @@ -693,7 +693,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, const char *prefix) } else { - if (list->class != no_set_class) + if (list->theclass != no_set_class) { struct cleanup *option_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "option"); |