aboutsummaryrefslogtreecommitdiff
path: root/gdb/spu-tdep.c
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/spu-tdep.c
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/spu-tdep.c')
-rw-r--r--gdb/spu-tdep.c18
1 files changed, 13 insertions, 5 deletions
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;