aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2003-08-08 14:46:41 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2003-08-08 14:46:41 +0000
commitc04898f807516f8361a4ec6f55b984bdf0955f7e (patch)
tree6a90d5b09ae4147038486dfddb9130bd4785f0a2 /gas/config
parent9a146a111fcdf46255451553ef8be9bb571e5853 (diff)
downloadgdb-c04898f807516f8361a4ec6f55b984bdf0955f7e.zip
gdb-c04898f807516f8361a4ec6f55b984bdf0955f7e.tar.gz
gdb-c04898f807516f8361a4ec6f55b984bdf0955f7e.tar.bz2
gas/
* config/tc-m68k.h (TARGET_USE_CFIPOP) (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT) (tc_regname_to_dw2regnum, tc_cfi_frame_initial_instructions): Define. * config/tc-m68k.c: Include "dw2gencfi.h". (tc_m68k_regname_to_dw2regnum) (tc_m68k_frame_initial_instructions): New functions. gas/testsuite/ * gas/cfi/cfi-m68k.s, gas/cfi/cfi-m68k.d: New test. * gas/cfi/cfi.exp (run_list_test): Run it.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-m68k.c34
-rw-r--r--gas/config/tc-m68k.h12
2 files changed, 45 insertions, 1 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index d913dc6..2c213c6 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -1,6 +1,6 @@
/* tc-m68k.c -- Assemble for the m68k family
Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -25,6 +25,7 @@
#include "obstack.h"
#include "subsegs.h"
#include "dwarf2dbg.h"
+#include "dw2gencfi.h"
#include "opcode/m68k.h"
#include "m68k-parse.h"
@@ -7146,3 +7147,34 @@ m68k_elf_final_processing ()
elf_elfheader (stdoutput)->e_flags |= EF_M68000;
}
#endif
+
+int
+tc_m68k_regname_to_dw2regnum (const char *regname)
+{
+ unsigned int regnum;
+ static const char *const regnames[] =
+ {
+ "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+ "a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp",
+ "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7",
+ "pc"
+ };
+
+ for (regnum = 0; regnum < ARRAY_SIZE (regnames); regnum++)
+ if (strcmp (regname, regnames[regnum]) == 0)
+ return regnum;
+
+ return -1;
+}
+
+void
+tc_m68k_frame_initial_instructions (void)
+{
+ static int sp_regno = -1;
+
+ if (sp_regno < 0)
+ sp_regno = tc_m68k_regname_to_dw2regnum ("sp");
+
+ cfi_add_CFA_def_cfa (sp_regno, -DWARF2_CIE_DATA_ALIGNMENT);
+ cfi_add_CFA_offset (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT);
+}
diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h
index 4770300..1182820 100644
--- a/gas/config/tc-m68k.h
+++ b/gas/config/tc-m68k.h
@@ -220,3 +220,15 @@ extern struct relax_type md_relax_table[];
while (0)
#define DWARF2_LINE_MIN_INSN_LENGTH 2
+
+/* We want .cfi_* pseudo-ops for generating unwind info. */
+#define TARGET_USE_CFIPOP 1
+
+#define DWARF2_DEFAULT_RETURN_COLUMN 24
+#define DWARF2_CIE_DATA_ALIGNMENT (-4)
+
+#define tc_regname_to_dw2regnum tc_m68k_regname_to_dw2regnum
+extern int tc_m68k_regname_to_dw2regnum (const char *regname);
+
+#define tc_cfi_frame_initial_instructions tc_m68k_frame_initial_instructions
+extern void tc_m68k_frame_initial_instructions (void);