aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@rr.iij4u.or.jp>2004-03-18 00:49:23 +0000
committerKaz Kojima <kkojima@rr.iij4u.or.jp>2004-03-18 00:49:23 +0000
commit2ce4cc60250621eab0d9ae587e8b2ba1b8603236 (patch)
tree263779898cef850321638cf84ca46c84ca15b975 /gas/config/tc-sh.c
parentcfef7cefb00af49639f979223382c5e837d9e78e (diff)
downloadgdb-2ce4cc60250621eab0d9ae587e8b2ba1b8603236.zip
gdb-2ce4cc60250621eab0d9ae587e8b2ba1b8603236.tar.gz
gdb-2ce4cc60250621eab0d9ae587e8b2ba1b8603236.tar.bz2
[gas]
* config/tc-sh.c: Include dw2gencfi.h. (sh_cfi_frame_initial_instructions): New function. (sh_regname_to_dw2regnum): Likewise. * config/tc-sh.h (DWARF2_LINE_MIN_INSN_LENGTH): Move to the end of file. (TARGET_USE_CFIPOP): Define. (tc_cfi_frame_initial_instructions): Likewise. (tc_regname_to_dw2regnum): Likewise. (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Likewise. * Makefile.am: Update dependencies. * Makefile.in: Regenerate. [gas/testsuite] * gas/cfi/cfi-sh-1.d: New file. * gas/cfi/cfi-sh-1.s: Likewise. * gas/cfi/cfi.exp: Add SH case.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index f3af8ab..7f7e28e 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -35,6 +35,7 @@
#endif
#include "dwarf2dbg.h"
+#include "dw2gencfi.h"
typedef struct
{
@@ -4341,4 +4342,53 @@ sh_parse_name (char const *name, expressionS *exprP, char *nextcharP)
return 1;
}
#endif
+
+void
+sh_cfi_frame_initial_instructions (void)
+{
+ cfi_add_CFA_def_cfa (15, 0);
+}
+
+int
+sh_regname_to_dw2regnum (const char *regname)
+{
+ unsigned int regnum = -1;
+ unsigned int i;
+ const char *p;
+ char *q;
+ static struct { char *name; int dw2regnum; } regnames[] =
+ {
+ { "pr", 17 }, { "t", 18 }, { "gbr", 19 }, { "mach", 20 },
+ { "macl", 21 }, { "fpul", 23 }
+ };
+
+ for (i = 0; i < ARRAY_SIZE (regnames); ++i)
+ if (strcmp (regnames[i].name, regname) == 0)
+ return regnames[i].dw2regnum;
+
+ if (regname[0] == 'r')
+ {
+ p = regname + 1;
+ regnum = strtoul (p, &q, 10);
+ if (p == q || *q || regnum >= 16)
+ return -1;
+ }
+ else if (regname[0] == 'f' && regname[1] == 'r')
+ {
+ p = regname + 2;
+ regnum = strtoul (p, &q, 10);
+ if (p == q || *q || regnum >= 16)
+ return -1;
+ regnum += 25;
+ }
+ else if (regname[0] == 'x' && regname[1] == 'd')
+ {
+ p = regname + 2;
+ regnum = strtoul (p, &q, 10);
+ if (p == q || *q || regnum >= 8)
+ return -1;
+ regnum += 87;
+ }
+ return regnum;
+}
#endif /* BFD_ASSEMBLER */