aboutsummaryrefslogtreecommitdiff
path: root/gdb/sh-tdep.c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2012-02-17 08:39:57 +0000
committerThomas Schwinge <tschwinge@gnu.org>2012-02-17 08:39:57 +0000
commitca193e277905cd464dfd5cf1b8391017a7a861ec (patch)
treed2c79a7c7e7610feb5de21a51c137419ed7fe3f1 /gdb/sh-tdep.c
parentd0ddfe27502fccf0e608a0f6080e8075847399b6 (diff)
downloadfsf-binutils-gdb-ca193e277905cd464dfd5cf1b8391017a7a861ec.zip
fsf-binutils-gdb-ca193e277905cd464dfd5cf1b8391017a7a861ec.tar.gz
fsf-binutils-gdb-ca193e277905cd464dfd5cf1b8391017a7a861ec.tar.bz2
* sh-tdep.c (sh_is_renesas_calling_convention): Fix handling of
TYPE_CALLING_CONVENTION annotation.
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r--gdb/sh-tdep.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 635939d..12116fd 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -89,9 +89,24 @@ struct sh_frame_cache
static int
sh_is_renesas_calling_convention (struct type *func_type)
{
- return ((func_type
- && TYPE_CALLING_CONVENTION (func_type) == DW_CC_GNU_renesas_sh)
- || sh_active_calling_convention == sh_cc_renesas);
+ int val = 0;
+
+ 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_GNU_renesas_sh)
+ val = 1;
+ }
+
+ if (sh_active_calling_convention == sh_cc_renesas)
+ val = 1;
+
+ return val;
}
static const char *