From 598cfb7174ee26b0cd3134f1505de0aedfdd5765 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 16 Nov 2011 18:30:09 +0000 Subject: * spu-tdep.c (spu_return_value): Fix handling of TYPE_CALLING_CONVENTION annotation. --- gdb/ChangeLog | 5 +++++ gdb/spu-tdep.c | 18 +++++++++++++----- 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 + * spu-tdep.c (spu_return_value): Fix handling of + TYPE_CALLING_CONVENTION annotation. + +2011-11-16 Ulrich Weigand + * 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; -- cgit v1.1