Address class support.
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 3ef1828cd40efda9dfa819ab6124e6d021158ecc..5f0d4fe36493c510cae45a610496494ced38abf8 100644 (file)
@@ -397,11 +397,15 @@ lookup_function_type (struct type *type)
 extern int
 address_space_name_to_int (char *space_identifier)
 {
+  int type_flags;
   /* Check for known address space delimiters. */
   if (!strcmp (space_identifier, "code"))
     return TYPE_FLAG_CODE_SPACE;
   else if (!strcmp (space_identifier, "data"))
     return TYPE_FLAG_DATA_SPACE;
+  else if (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P ()
+           && ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (space_identifier, &type_flags))
+    return type_flags;
   else
     error ("Unknown address space specifier: \"%s\"", space_identifier);
 }
@@ -416,6 +420,9 @@ address_space_int_to_name (int space_flag)
     return "code";
   else if (space_flag & TYPE_FLAG_DATA_SPACE)
     return "data";
+  else if ((space_flag & TYPE_FLAG_ADDRESS_CLASS_ALL)
+           && ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P ())
+    return ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (space_flag);
   else
     return NULL;
 }
@@ -465,14 +472,17 @@ make_qualified_type (struct type *type, int new_flags,
    is identical to the one supplied except that it has an address
    space attribute attached to it (such as "code" or "data").
 
-   This is for Harvard architectures. */
+   The space attributes "code" and "data" are for Harvard architectures.
+   The address space attributes are for architectures which have
+   alternately sized pointers or pointers with alternate representations.  */
 
 struct type *
 make_type_with_address_space (struct type *type, int space_flag)
 {
   struct type *ntype;
   int new_flags = ((TYPE_INSTANCE_FLAGS (type)
-                   & ~(TYPE_FLAG_CODE_SPACE | TYPE_FLAG_DATA_SPACE))
+                   & ~(TYPE_FLAG_CODE_SPACE | TYPE_FLAG_DATA_SPACE
+                       | TYPE_FLAG_ADDRESS_CLASS_ALL))
                   | space_flag);
 
   return make_qualified_type (type, new_flags, NULL);
@@ -3140,6 +3150,14 @@ recursive_dump_type (struct type *type, int spaces)
     {
       puts_filtered (" TYPE_FLAG_DATA_SPACE");
     }
+  if (TYPE_ADDRESS_CLASS_1 (type))
+    {
+      puts_filtered (" TYPE_FLAG_ADDRESS_CLASS_1");
+    }
+  if (TYPE_ADDRESS_CLASS_2 (type))
+    {
+      puts_filtered (" TYPE_FLAG_ADDRESS_CLASS_2");
+    }
   puts_filtered ("\n");
   printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
   if (TYPE_UNSIGNED (type))
This page took 0.024288 seconds and 4 git commands to generate.