aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2011-11-16 18:30:09 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2011-11-16 18:30:09 +0000
commit598cfb7174ee26b0cd3134f1505de0aedfdd5765 (patch)
tree372c278c09f6a50e301e76ecbdacf3957dce7a65 /gdb
parentcaf4328c57b4f7a01b457dcd3137aba195f2c445 (diff)
downloadgdb-598cfb7174ee26b0cd3134f1505de0aedfdd5765.zip
gdb-598cfb7174ee26b0cd3134f1505de0aedfdd5765.tar.gz
gdb-598cfb7174ee26b0cd3134f1505de0aedfdd5765.tar.bz2
* spu-tdep.c (spu_return_value): Fix handling of
TYPE_CALLING_CONVENTION annotation.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/spu-tdep.c18
2 files changed, 18 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6915959..cfc14d3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2011-11-16 Ulrich Weigand <uweigand@de.ibm.com>
+ * spu-tdep.c (spu_return_value): Fix handling of
+ TYPE_CALLING_CONVENTION annotation.
+
+2011-11-16 Ulrich Weigand <uweigand@de.ibm.com>
+
* skip.c (skip_function_command): Work around uninitialized
variable warning.
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index d42d94b..080bed0 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1458,11 +1458,19 @@ spu_return_value (struct gdbarch *gdbarch, struct type *func_type,
enum return_value_convention rvc;
int opencl_vector = 0;
- if (func_type
- && TYPE_CALLING_CONVENTION (func_type) == DW_CC_GDB_IBM_OpenCL
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
- opencl_vector = 1;
+ if (func_type)
+ {
+ func_type = check_typedef (func_type);
+
+ if (TYPE_CODE (func_type) == TYPE_CODE_PTR)
+ func_type = check_typedef (TYPE_TARGET_TYPE (func_type));
+
+ if (TYPE_CODE (func_type) == TYPE_CODE_FUNC
+ && TYPE_CALLING_CONVENTION (func_type) == DW_CC_GDB_IBM_OpenCL
+ && TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && TYPE_VECTOR (type))
+ opencl_vector = 1;
+ }
if (TYPE_LENGTH (type) <= (SPU_ARGN_REGNUM - SPU_ARG1_REGNUM + 1) * 16)
rvc = RETURN_VALUE_REGISTER_CONVENTION;