* command.h (cmd_auto_boolean): Delete enum.
* mips-tdep.c (mask_address_var): Update.
(mips_mask_address_p): Update.
(show_mask_address): Update.
* remote.c (struct packet_config): Update.
(update_packet_config): Update.
(show_packet_config_cmd): Update.
(packet_ok): Update.
(add_packet_config_cmd): Update.
(_initialize_remote):
* command.h: Update.
* cli/cli-setshow.c (parse_auto_binary_operation): Update.
(do_setshow_command): Update.
* cli/cli-decode.c (add_set_auto_boolean_cmd): Update.
* cli/cli-decode.h: Update.
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (auto_boolean): Declare enum.
+ * command.h (cmd_auto_boolean): Delete enum.
+ * mips-tdep.c (mask_address_var): Update.
+ (mips_mask_address_p): Update.
+ (show_mask_address): Update.
+ * remote.c (struct packet_config): Update.
+ (update_packet_config): Update.
+ (show_packet_config_cmd): Update.
+ (packet_ok): Update.
+ (add_packet_config_cmd): Update.
+ (_initialize_remote):
+ * command.h: Update.
+ * cli/cli-setshow.c (parse_auto_binary_operation): Update.
+ (do_setshow_command): Update.
+ * cli/cli-decode.c (add_set_auto_boolean_cmd): Update.
+ * cli/cli-decode.h: Update.
+
2002-06-15 Mark Kettenis <kettenis@gnu.org>
* config/i386/tm-cygwin.h, config/i386/tm-fbsd.h,
struct cmd_list_element *
add_set_auto_boolean_cmd (char *name,
enum command_class class,
- enum cmd_auto_boolean *var,
+ enum auto_boolean *var,
char *doc,
struct cmd_list_element **list)
{
extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
enum command_class class,
- enum cmd_auto_boolean *var,
+ enum auto_boolean *var,
char *doc,
struct cmd_list_element **list);
static int parse_binary_operation (char *);
-static enum cmd_auto_boolean parse_auto_binary_operation (const char *arg);
\f
-static enum cmd_auto_boolean
+static enum auto_boolean
parse_auto_binary_operation (const char *arg)
{
if (arg != NULL && *arg != '\0')
|| strncmp (arg, "1", length) == 0
|| strncmp (arg, "yes", length) == 0
|| strncmp (arg, "enable", length) == 0)
- return CMD_AUTO_BOOLEAN_TRUE;
+ return AUTO_BOOLEAN_TRUE;
else if (strncmp (arg, "off", length) == 0
|| strncmp (arg, "0", length) == 0
|| strncmp (arg, "no", length) == 0
|| strncmp (arg, "disable", length) == 0)
- return CMD_AUTO_BOOLEAN_FALSE;
+ return AUTO_BOOLEAN_FALSE;
else if (strncmp (arg, "auto", length) == 0
|| (strncmp (arg, "-1", length) == 0 && length > 1))
- return CMD_AUTO_BOOLEAN_AUTO;
+ return AUTO_BOOLEAN_AUTO;
}
error ("\"on\", \"off\" or \"auto\" expected.");
- return CMD_AUTO_BOOLEAN_AUTO; /* pacify GCC */
+ return AUTO_BOOLEAN_AUTO; /* pacify GCC */
}
static int
*(int *) c->var = parse_binary_operation (arg);
break;
case var_auto_boolean:
- *(enum cmd_auto_boolean *) c->var = parse_auto_binary_operation (arg);
+ *(enum auto_boolean *) c->var = parse_auto_binary_operation (arg);
break;
case var_uinteger:
if (arg == NULL)
fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
break;
case var_auto_boolean:
- switch (*(enum cmd_auto_boolean*) c->var)
+ switch (*(enum auto_boolean*) c->var)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
fputs_filtered ("on", stb->stream);
break;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
fputs_filtered ("off", stb->stream);
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
fputs_filtered ("auto", stb->stream);
break;
default:
}
cmd_types;
-/* Reasonable values for an AUTO_BOOLEAN variable. */
-enum cmd_auto_boolean
-{
- CMD_AUTO_BOOLEAN_TRUE,
- CMD_AUTO_BOOLEAN_FALSE,
- CMD_AUTO_BOOLEAN_AUTO
-};
-
/* Types of "set" or "show" command. */
typedef enum var_types
{
var_boolean,
/* "on" / "true" / "enable" or "off" / "false" / "disable" or
- "auto. *VAR is an ``enum cmd_auto_boolean''. NOTE: In general
- a custom show command will need to be implemented - one that
- for "auto" prints both the "auto" and the current auto-selected
+ "auto. *VAR is an ``enum auto_boolean''. NOTE: In general a
+ custom show command will need to be implemented - one that for
+ "auto" prints both the "auto" and the current auto-selected
value. */
var_auto_boolean,
extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
enum command_class class,
- enum cmd_auto_boolean *var,
+ enum auto_boolean *var,
char *doc,
struct cmd_list_element **list);
unspecified_precision
};
+/* A generic, not quite boolean, enumeration. */
+enum auto_boolean
+{
+ AUTO_BOOLEAN_TRUE,
+ AUTO_BOOLEAN_FALSE,
+ AUTO_BOOLEAN_AUTO
+};
+
/* the cleanup list records things that have to be undone
if an error happens (descriptors to be closed, memory to be freed, etc.)
Each link in the chain records a function to call and an
}
/* Should the upper word of 64-bit addresses be zeroed? */
-enum cmd_auto_boolean mask_address_var = CMD_AUTO_BOOLEAN_AUTO;
+enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO;
static int
mips_mask_address_p (void)
{
switch (mask_address_var)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
return 1;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
return 0;
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
return MIPS_DEFAULT_MASK_ADDRESS_P;
default:
internal_error (__FILE__, __LINE__,
{
switch (mask_address_var)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
printf_filtered ("The 32 bit mips address mask is enabled\n");
break;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
printf_filtered ("The 32 bit mips address mask is disabled\n");
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
printf_filtered ("The 32 bit address mask is set automatically. Currently %s\n",
mips_mask_address_p () ? "enabled" : "disabled");
break;
{
char *name;
char *title;
- enum cmd_auto_boolean detect;
+ enum auto_boolean detect;
enum packet_support support;
};
{
switch (config->detect)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
config->support = PACKET_ENABLE;
break;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
config->support = PACKET_DISABLE;
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
config->support = PACKET_SUPPORT_UNKNOWN;
break;
}
}
switch (config->detect)
{
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
printf_filtered ("Support for remote protocol `%s' (%s) packet is auto-detected, currently %s.\n",
config->name, config->title, support);
break;
- case CMD_AUTO_BOOLEAN_TRUE:
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_FALSE:
printf_filtered ("Support for remote protocol `%s' (%s) packet is currently %s.\n",
config->name, config->title, support);
break;
char *cmd_name;
config->name = name;
config->title = title;
- config->detect = CMD_AUTO_BOOLEAN_AUTO;
+ config->detect = AUTO_BOOLEAN_AUTO;
config->support = PACKET_SUPPORT_UNKNOWN;
xasprintf (&set_doc, "Set use of remote protocol `%s' (%s) packet",
name, title);
switch (config->support)
{
case PACKET_ENABLE:
- if (config->detect == CMD_AUTO_BOOLEAN_AUTO)
+ if (config->detect == AUTO_BOOLEAN_AUTO)
/* If the stub previously indicated that the packet was
supported then there is a protocol error.. */
error ("Protocol error: %s (%s) conflicting enabled responses.",
/* For compatibility with older distributions. Provide a ``set remote
Z-packet ...'' command that updates all the Z packet types. */
-static enum cmd_auto_boolean remote_Z_packet_detect;
+static enum auto_boolean remote_Z_packet_detect;
static void
set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
0);
/* Disable by default. The ``e'' packet has nasty interactions with
the threading code - it relies on global state. */
- remote_protocol_e.detect = CMD_AUTO_BOOLEAN_FALSE;
+ remote_protocol_e.detect = AUTO_BOOLEAN_FALSE;
update_packet_config (&remote_protocol_e);
add_packet_config_cmd (&remote_protocol_E,
0);
/* Disable by default. The ``e'' packet has nasty interactions with
the threading code - it relies on global state. */
- remote_protocol_E.detect = CMD_AUTO_BOOLEAN_FALSE;
+ remote_protocol_E.detect = AUTO_BOOLEAN_FALSE;
update_packet_config (&remote_protocol_E);
add_packet_config_cmd (&remote_protocol_P,
child->name = name;
child->index = index;
child->value = value_of_child (parent, index);
- if ((!CPLUS_FAKE_CHILD(child) && child->value == NULL) || parent->error)
+ if ((!CPLUS_FAKE_CHILD (child) && child->value == NULL) || parent->error)
child->error = 1;
child->parent = parent;
child->root = parent->root;
if (value != NULL && VALUE_LAZY (value))
{
/* If we fail to fetch the value of the child, return
- NULL so that callers notice that we're leaving an
- error message. */
+ NULL so that callers notice that we're leaving an
+ error message. */
if (!gdb_value_fetch_lazy (value))
value = NULL;
}
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL,
+ "vstructure");
break;
case TYPE_CODE_PTR:
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL,
+ "vstructure");
break;
default:
{
if (VALUE_LAZY (var->value))
gdb_value_fetch_lazy (var->value);
- val_print (VALUE_TYPE (var->value), VALUE_CONTENTS_RAW (var->value), 0,
- VALUE_ADDRESS (var->value),
- stb, format_code[(int) var->format], 1, 0, 0);
+ val_print (VALUE_TYPE (var->value),
+ VALUE_CONTENTS_RAW (var->value), 0,
+ VALUE_ADDRESS (var->value), stb,
+ format_code[(int) var->format], 1, 0, 0);
thevalue = ui_file_xstrdup (stb, &dummy);
do_cleanups (old_chain);
}
/* FIXME: This assumes that type orders
inherited, public, private, protected */
i = index + TYPE_N_BASECLASSES (type);
- if (STREQ (parent->name, "private") || STREQ (parent->name, "protected"))
+ if (STREQ (parent->name, "private")
+ || STREQ (parent->name, "protected"))
i += children[v_public];
if (STREQ (parent->name, "protected"))
i += children[v_private];