* sh-tdep.c (sh_is_renesas_calling_convention): Fix handling of
authorThomas Schwinge <tschwinge@gnu.org>
Fri, 17 Feb 2012 08:39:57 +0000 (08:39 +0000)
committerThomas Schwinge <tschwinge@gnu.org>
Fri, 17 Feb 2012 08:39:57 +0000 (08:39 +0000)
TYPE_CALLING_CONVENTION annotation.

gdb/ChangeLog
gdb/sh-tdep.c

index daa0a90eacfdaedd42976436df754ca7cc3ce63a..150760bdd5e01d9bc8465d78ebd72f7fe531c2bc 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-17  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * sh-tdep.c (sh_is_renesas_calling_convention): Fix handling of
+       TYPE_CALLING_CONVENTION annotation.
+
 2012-02-16  Kevin Buettner  <kevinb@redhat.com>
 
        * MAINTAINERS: Add rx to target ISA section.
index 635939dd67d0c6ddab1b3b9058887ca86386a460..12116fd83b33fe66e381e6f2ae055fbea73c3144 100644 (file)
@@ -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 *