gdb:
authorKen Werner <ken.werner@de.ibm.com>
Wed, 6 Oct 2010 08:44:15 +0000 (08:44 +0000)
committerKen Werner <ken.werner@de.ibm.com>
Wed, 6 Oct 2010 08:44:15 +0000 (08:44 +0000)
* gdbtypes.h (struct main_type): Remove flag_nottext.
(enum type_flag_value): Remove TYPE_FLAG_NOTTEXT.
(enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_NOTTEXT.
(TYPE_NOTTEXT): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of flag_nottext.
* gdbtypes.c (make_vector_type): Use TYPE_INSTANCE_FLAG_NOTTEXT instead
of TYPE_FLAG_NOTTEXT.
(init_type): Remove the initialization of the flag_nottext field.
(gdbtypes_post_init): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of
TYPE_FLAG_NOTTEXT.
* c-valprint.c (c_val_print): Remove TYPE_VECTOR check.
gdb/testsuite:
* gdb.base/gnu_vector.c: Add variable c4.
* gdb.base/gnu_vector.exp: Add tests for character vector printing.
* gdb.arch/altivec-abi.exp: Fix expect pattern of character vectors.

gdb/ChangeLog
gdb/c-valprint.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/altivec-abi.exp
gdb/testsuite/gdb.base/gnu_vector.c
gdb/testsuite/gdb.base/gnu_vector.exp

index 7968e937ffa951b0e966e417e4243d2e04a9e11f..62045effc0f59c12f88689cf55316289ff44f84d 100644 (file)
@@ -1,3 +1,16 @@
+2010-10-06  Ken Werner  <ken.werner@de.ibm.com>
+
+       * gdbtypes.h (struct main_type): Remove flag_nottext.
+       (enum type_flag_value): Remove TYPE_FLAG_NOTTEXT.
+       (enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_NOTTEXT.
+       (TYPE_NOTTEXT): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of flag_nottext.
+       * gdbtypes.c (make_vector_type): Use TYPE_INSTANCE_FLAG_NOTTEXT instead
+       of TYPE_FLAG_NOTTEXT.
+       (init_type): Remove the initialization of the flag_nottext field.
+       (gdbtypes_post_init): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of
+       TYPE_FLAG_NOTTEXT.
+       * c-valprint.c (c_val_print): Remove TYPE_VECTOR check.
+
 2010-10-04  Doug Evans  <dje@google.com>
 
        * cc-with-index.sh: New file.
index f0895a4d9c1ee462d120fef5055011598c648370..521460b21fca98113ac5a3692f068b7c306c0973 100644 (file)
@@ -180,8 +180,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 
          /* Print arrays of textual chars with a string syntax, as
             long as the entire array is valid.  */
-          if (!TYPE_VECTOR (type)
-             && c_textual_element_type (unresolved_elttype, options->format)
+          if (c_textual_element_type (unresolved_elttype, options->format)
              && value_bits_valid (original_value,
                                   TARGET_CHAR_BIT * embedded_offset,
                                   TARGET_CHAR_BIT * TYPE_LENGTH (type)))
index c35adbb84b923436b1914edf33c86fcb98f8fd58..af28ca122e9541f7e8088c0161a5e3dee1012723 100644 (file)
@@ -942,7 +942,7 @@ make_vector_type (struct type *array_type)
   elt_type = TYPE_TARGET_TYPE (inner_array);
   if (TYPE_CODE (elt_type) == TYPE_CODE_INT)
     {
-      flags = TYPE_INSTANCE_FLAGS (elt_type) | TYPE_FLAG_NOTTEXT;
+      flags = TYPE_INSTANCE_FLAGS (elt_type) | TYPE_INSTANCE_FLAG_NOTTEXT;
       elt_type = make_qualified_type (elt_type, flags, NULL);
       TYPE_TARGET_TYPE (inner_array) = elt_type;
     }
@@ -1801,8 +1801,6 @@ init_type (enum type_code code, int length, int flags,
     TYPE_VECTOR (type) = 1;
   if (flags & TYPE_FLAG_STUB_SUPPORTED)
     TYPE_STUB_SUPPORTED (type) = 1;
-  if (flags & TYPE_FLAG_NOTTEXT)
-    TYPE_NOTTEXT (type) = 1;
   if (flags & TYPE_FLAG_FIXED_INSTANCE)
     TYPE_FIXED_INSTANCE (type) = 1;
 
@@ -3490,8 +3488,10 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
     = arch_integer_type (gdbarch, 128, 0, "int128_t");
   builtin_type->builtin_uint128
     = arch_integer_type (gdbarch, 128, 1, "uint128_t");
-  TYPE_NOTTEXT (builtin_type->builtin_int8) = 1;
-  TYPE_NOTTEXT (builtin_type->builtin_uint8) = 1;
+  TYPE_INSTANCE_FLAGS (builtin_type->builtin_int8) |=
+    TYPE_INSTANCE_FLAG_NOTTEXT;
+  TYPE_INSTANCE_FLAGS (builtin_type->builtin_uint8) |=
+    TYPE_INSTANCE_FLAG_NOTTEXT;
 
   /* Wide character types.  */
   builtin_type->builtin_char16
index dba7284377d86e862ea09c7af884ba39adc690e0..a6e5762a1fa424594b2becc9612fb60e8f6d832b 100644 (file)
@@ -159,18 +159,17 @@ enum type_code
 
 enum type_flag_value
 {
-  TYPE_FLAG_UNSIGNED = (1 << 6),
-  TYPE_FLAG_NOSIGN = (1 << 7),
-  TYPE_FLAG_STUB = (1 << 8),
-  TYPE_FLAG_TARGET_STUB = (1 << 9),
-  TYPE_FLAG_STATIC = (1 << 10),
-  TYPE_FLAG_PROTOTYPED = (1 << 11),
-  TYPE_FLAG_INCOMPLETE = (1 << 12),
-  TYPE_FLAG_VARARGS = (1 << 13),
-  TYPE_FLAG_VECTOR = (1 << 14),
-  TYPE_FLAG_FIXED_INSTANCE = (1 << 15),
-  TYPE_FLAG_STUB_SUPPORTED = (1 << 16),
-  TYPE_FLAG_NOTTEXT = (1 << 17),
+  TYPE_FLAG_UNSIGNED = (1 << 7),
+  TYPE_FLAG_NOSIGN = (1 << 8),
+  TYPE_FLAG_STUB = (1 << 9),
+  TYPE_FLAG_TARGET_STUB = (1 << 10),
+  TYPE_FLAG_STATIC = (1 << 11),
+  TYPE_FLAG_PROTOTYPED = (1 << 12),
+  TYPE_FLAG_INCOMPLETE = (1 << 13),
+  TYPE_FLAG_VARARGS = (1 << 14),
+  TYPE_FLAG_VECTOR = (1 << 15),
+  TYPE_FLAG_FIXED_INSTANCE = (1 << 16),
+  TYPE_FLAG_STUB_SUPPORTED = (1 << 17),
 
   /* Used for error-checking.  */
   TYPE_FLAG_MIN = TYPE_FLAG_UNSIGNED
@@ -186,7 +185,8 @@ enum type_instance_flag_value
   TYPE_INSTANCE_FLAG_CODE_SPACE = (1 << 2),
   TYPE_INSTANCE_FLAG_DATA_SPACE = (1 << 3),
   TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 = (1 << 4),
-  TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2 = (1 << 5)
+  TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2 = (1 << 5),
+  TYPE_INSTANCE_FLAG_NOTTEXT = (1 << 6),
 };
 
 /* Unsigned integer type.  If this is not set for a TYPE_CODE_INT, the
@@ -269,7 +269,7 @@ enum type_instance_flag_value
 /* Not textual.  By default, GDB treats all single byte integers as
    characters (or elements of strings) unless this flag is set.  */
 
-#define TYPE_NOTTEXT(t)                (TYPE_MAIN_TYPE (t)->flag_nottext)
+#define TYPE_NOTTEXT(t)        (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_NOTTEXT)
 
 /* Type owner.  If TYPE_OBJFILE_OWNED is true, the type is owned by
    the objfile retrieved as TYPE_OBJFILE.  Otherweise, the type is
@@ -388,7 +388,6 @@ struct main_type
   unsigned int flag_varargs : 1;
   unsigned int flag_vector : 1;
   unsigned int flag_stub_supported : 1;
-  unsigned int flag_nottext : 1;
   unsigned int flag_fixed_instance : 1;
   unsigned int flag_objfile_owned : 1;
   /* True if this type was declared with "class" rather than
index dfa5f0824b038d024e91caabbaddf711a23afa5e..f7d3eb5c258946325481939456b0aeda69bd79e2 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-06  Ken Werner  <ken.werner@de.ibm.com>
+
+       * gdb.base/gnu_vector.c: Add variable c4.
+       * gdb.base/gnu_vector.exp: Add tests for character vector printing.
+       * gdb.arch/altivec-abi.exp: Fix expect pattern of character vectors.
+
 2010-10-05  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * gdb.arch/altivec-abi.exp: Fix a typo.
index 72723d8c962638c69960b1975829da9b845ed8f1..9915ee41187cd2417eaf8ec2905aca784f96624e 100644 (file)
@@ -82,7 +82,7 @@ proc altivec_abi_tests { extra_flags force_abi } {
 
     # now all the arguments of vec_fun are initialized
 
-    set pattern "vec_func .vshort_f=.111, 222, 333, 444, 555, 666, 777, 888., vushort_f=.100, 200, 300, 400, 500, 600, 700, 800., vint_f=.-10, -20, -30, -40., vuint_f=.1111, 2222, 3333, 4444., vchar_f=.97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g', 104 'h', 105 'i', 108 'l', 109 'm', 110 'n', 111 'o', 112 'p', 113 'q', 114 'r'., vuchar_f=.65 'A', 66 'B', 67 'C', 68 'D', 69 'E', 70 'F', 71 'G', 72 'H', 73 'I', 76 'L', 77 'M', 78 'N', 79 'O', 80 'P', 81 'Q', 82 'R'., vfloat_f=.1.25, 3.75, 5.5, 1.25., x_f=.1, 2, 3, 4, 5, 6, 7, 8., y_f=.12, 22, 32, 42., a_f=.118 'v', 101 'e', 99 'c', 116 't', 111 'o', 114 'r', 32 ' ', 111 'o', 102 'f', 32 ' ', 99 'c', 104 'h', 97 'a', 114 'r', 115 's', 46 '.'., b_f=.5.5, 4.5, 3.75, 2.25., c_f=.1.25, 3.5, 5.5, 7.75., intv_on_stack_f=.12, 34, 56, 78.."
+    set pattern "vec_func .vshort_f=.111, 222, 333, 444, 555, 666, 777, 888., vushort_f=.100, 200, 300, 400, 500, 600, 700, 800., vint_f=.-10, -20, -30, -40., vuint_f=.1111, 2222, 3333, 4444., vchar_f=.97, 98, 99, 100, 101, 102, 103, 104, 105, 108, 109, 110, 111, 112, 113, 114., vuchar_f=.65, 66, 67, 68, 69, 70, 71, 72, 73, 76, 77, 78, 79, 80, 81, 82., vfloat_f=.1.25, 3.75, 5.5, 1.25., x_f=.1, 2, 3, 4, 5, 6, 7, 8., y_f=.12, 22, 32, 42., a_f=.118, 101, 99, 116, 111, 114, 32, 111, 102, 32, 99, 104, 97, 114, 115, 46., b_f=.5.5, 4.5, 3.75, 2.25., c_f=.1.25, 3.5, 5.5, 7.75., intv_on_stack_f=.12, 34, 56, 78.."
 
     set pattern1 $pattern
     append pattern1 " at.*altivec-abi.c.*vint_res  = vec_add.*vint_f, intv_on_stack_f.;"
index 8efb4cb8f28d23a25b332d8e0a33accaf27907b2..4bcb6e58b2a99ef8699dd00443550c67dc3fa763 100644 (file)
@@ -17,6 +17,7 @@
 
    Contributed by Ken Werner <ken.werner@de.ibm.com>  */
 
+char __attribute__ ((vector_size (4 * sizeof(char)))) c4 = {1, 2, 3, 4};
 int __attribute__ ((vector_size (4 * sizeof(int)))) i4a = {2, 4, 8, 16};
 int __attribute__ ((vector_size (4 * sizeof(int)))) i4b = {1, 2, 8, 4};
 float __attribute__ ((vector_size (4 * sizeof(float)))) f4a = {2, 4, 8, 16};
index b2f1dab684ae00d80b0891455f88786de406f3e3..bedc059382e1377dd38721ecb4a9dcd2f0b48530 100644 (file)
@@ -46,6 +46,10 @@ if { ![runto main] } {
     return -1
 }
 
+# Test printing of character vector types
+gdb_test "print c4" "\\\$$decimal = \\{1, 2, 3, 4\\}"
+gdb_test "print c4\[2\]" "\\\$$decimal = 3"
+
 # Test binary operators on integer vector types
 gdb_test "print i4a" "\\\$$decimal = \\{2, 4, 8, 16\\}"
 gdb_test "print i4b" "\\\$$decimal = \\{1, 2, 8, 4\\}"
This page took 0.044428 seconds and 4 git commands to generate.