summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraburgess <aburgess>2012-09-14 21:23:44 +0000
committeraburgess <aburgess>2012-09-14 21:23:44 +0000
commit429093471f5600c177271a5f309f09d01eb36bc3 (patch)
tree51929886b638bc8b020c6dab3749f16e5d8297ce
parent8314f8d6bb0c9ff33fa1b7af10d98cff44f19b27 (diff)
downloadgdb-429093471f5600c177271a5f309f09d01eb36bc3.tar.gz
http://sourceware.org/ml/gdb-patches/2012-09/msg00015.html
gdb/ChangeLog * c-typeprint.c (c_type_print_varspec_suffix): Display the size of vector variables using vector_size syntax rather than array syntax. gdb/testsuite/ChangeLog * gdb.xml/tdesc-regs.exp: Update expected output for new vector_size syntax of vector types.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/c-typeprint.c6
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.xml/tdesc-regs.exp6
4 files changed, 18 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index beaa8c22587..b5d48f6daeb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-14 Andrew Burgess <aburgess@broadcom.com>
+
+ * c-typeprint.c (c_type_print_varspec_suffix): Display the size of
+ vector variables using vector_size syntax rather than array
+ syntax.
+
2012-09-14 Siddhesh Poyarekar <siddhesh@redhat.com>
* valarith.c (value_concat): Replace unsafe ALLOCA with
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index b51ced88df3..92bc47d0f91 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -618,15 +618,17 @@ c_type_print_varspec_suffix (struct type *type,
case TYPE_CODE_ARRAY:
{
LONGEST low_bound, high_bound;
+ int is_vector = TYPE_VECTOR (type);
if (passed_a_ptr)
fprintf_filtered (stream, ")");
- fprintf_filtered (stream, "[");
+ fprintf_filtered (stream, (is_vector ?
+ "__attribute__ ((vector_size(" : "["));
if (get_array_bounds (type, &low_bound, &high_bound))
fprintf_filtered (stream, "%d",
(int) (high_bound - low_bound + 1));
- fprintf_filtered (stream, "]");
+ fprintf_filtered (stream, (is_vector ? ")))" : "]"));
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,
show, 0, 0);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 98c54a4709a..7fcf5209cd5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-14 Andrew Burgess <aburgess@broadcom.com>
+
+ * gdb.xml/tdesc-regs.exp: Update expected output for new
+ vector_size syntax of vector types.
+
2012-09-13 Khoo Yit Phang <khooyp@cs.umd.edu>
Refactor Python "gdb" module into a proper Python package, by
diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/tdesc-regs.exp
index 9a89d7ee77a..6d87dd32c91 100644
--- a/gdb/testsuite/gdb.xml/tdesc-regs.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp
@@ -137,13 +137,13 @@ proc load_description { file errmsg } {
load_description "extra-regs.xml" ""
gdb_test "ptype \$extrareg" "type = (int|long|long long)"
gdb_test "ptype \$uintreg" "type = uint32_t"
-gdb_test "ptype \$vecreg" "type = int8_t \\\[4\\\]"
+gdb_test "ptype \$vecreg" "type = int8_t __attribute__ \\(\\(vector_size\\(4\\)\\)\\)"
gdb_test "ptype \$unionreg" \
"type = union {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}"
-gdb_test "ptype \$unionreg.v4" "type = int8_t \\\[4\\\]"
+gdb_test "ptype \$unionreg.v4" "type = int8_t __attribute__ \\(\\(vector_size\\(4\\)\\)\\)"
gdb_test "ptype \$structreg" \
"type = struct struct1 {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}"
-gdb_test "ptype \$structreg.v4" "type = int8_t \\\[4\\\]"
+gdb_test "ptype \$structreg.v4" "type = int8_t __attribute__ \\(\\(vector_size\\(4\\)\\)\\)"
gdb_test "ptype \$bitfields" \
"type = struct struct2 {\r\n *uint64_t f1 : 35;\r\n *uint64_t f2 : 1;\r\n}"