* defs.h (auto_boolean): Declare enum.
authorAndrew Cagney <cagney@redhat.com>
Sat, 15 Jun 2002 18:45:32 +0000 (18:45 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 15 Jun 2002 18:45:32 +0000 (18:45 +0000)
* 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.

gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h
gdb/cli/cli-setshow.c
gdb/command.h
gdb/defs.h
gdb/mips-tdep.c
gdb/remote.c
gdb/varobj.c

index 96dd2690c275d09b39d40a524cf894e955cbf10d..987c8856eeae861e14a939d57c64f87a005e350e 100644 (file)
@@ -1,3 +1,22 @@
+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,
index 3f510ac87d173dce2103170cd6e5df02ef82b102..16be5e89a4e42b09e814d504775611c1fe8c84b8 100644 (file)
@@ -371,7 +371,7 @@ add_set_enum_cmd (char *name,
 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)
 {
index 72436f04657449ce46c90754bcad1e31d0580bb3..5b6f9682e7c81c30369d49b355294f8ac237c242 100644 (file)
@@ -296,7 +296,7 @@ extern struct cmd_list_element *add_set_enum_cmd (char *name,
 
 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);
 
index f967b0c3ebae30aea8df66a47dfa6d71ad573161..94ba94e16dd2607ac60ebe3db2ef11b039f02196 100644 (file)
@@ -34,9 +34,8 @@
 
 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')
@@ -48,18 +47,18 @@ parse_auto_binary_operation (const char *arg)
          || 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
@@ -167,7 +166,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
          *(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)
@@ -296,15 +295,15 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
          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:
index db7a74025845cc984b940ceb3b23fb551ffd1992..e8694828a0708026c57700da6ebea6b2e8c744d1 100644 (file)
@@ -51,14 +51,6 @@ typedef enum cmd_types
   }
 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
   {
@@ -67,9 +59,9 @@ 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,
 
@@ -231,7 +223,7 @@ extern struct cmd_list_element *add_set_enum_cmd (char *name,
 
 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);
 
index ab66d73118226974df3f37771d589a996ee4935e..e7698b55860110e468a6a04dccadb06364864f2f 100644 (file)
@@ -222,6 +222,14 @@ enum precision_type
     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
index d7f6d855ea0d4666304794d214d84e915300f7fa..85bac4f96a36230628fc7bbd673f4439b5cb7a12 100644 (file)
@@ -469,19 +469,19 @@ mips_register_convert_to_raw (struct type *virtual_type, int n,
 }
 
 /* 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__,
@@ -495,13 +495,13 @@ show_mask_address (char *cmd, int from_tty)
 {
   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;
index a1b90b7a5a4f928cb98810c972cd68aaea0b1576..9b3a4a82face5f09019f2c962957759c94355521 100644 (file)
@@ -583,7 +583,7 @@ struct packet_config
   {
     char *name;
     char *title;
-    enum cmd_auto_boolean detect;
+    enum auto_boolean detect;
     enum packet_support support;
   };
 
@@ -602,13 +602,13 @@ update_packet_config (struct packet_config *config)
 {
   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;
     }
@@ -632,12 +632,12 @@ show_packet_config_cmd (struct packet_config *config)
     }
   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;
@@ -664,7 +664,7 @@ add_packet_config_cmd (struct packet_config *config,
   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);
@@ -730,7 +730,7 @@ packet_ok (const char *buf, struct packet_config *config)
       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.",
@@ -906,7 +906,7 @@ show_remote_protocol_Z_access_wp_packet_cmd (char *args, int from_tty)
 /* 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,
@@ -6150,7 +6150,7 @@ in a memory packet.\n",
                         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,
@@ -6161,7 +6161,7 @@ in a memory packet.\n",
                         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,
index 9ae145e217090bc48d0713a5f54534a9b0c5341a..09b5a7cb88835fd6c3d4434dc0f6463ca8096a5b 100644 (file)
@@ -1210,7 +1210,7 @@ create_child (struct varobj *parent, int index, char *name)
   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;
@@ -1645,8 +1645,8 @@ value_of_child (struct varobj *parent, int index)
   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;
     }
@@ -1929,7 +1929,8 @@ c_value_of_child (struct varobj *parent, int index)
 
        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:
@@ -1937,7 +1938,8 @@ c_value_of_child (struct varobj *parent, int index)
            {
            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:
@@ -2062,9 +2064,10 @@ c_value_of_variable (struct varobj *var)
          {
            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);
          }
@@ -2200,7 +2203,8 @@ cplus_name_of_child (struct varobj *parent, int index)
          /* 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];
This page took 0.035426 seconds and 4 git commands to generate.