aboutsummaryrefslogtreecommitdiff
path: root/gdb/arc-tdep.h
diff options
context:
space:
mode:
authorAnton Kolesov <Anton.Kolesov@synopsys.com>2016-08-12 20:02:20 +0300
committerAnton Kolesov <Anton.Kolesov@synopsys.com>2016-09-21 21:07:06 +0300
commitad0a504f7e10ea11dbf58eb9990a5180f781b695 (patch)
tree3ea333a32246db9c625590e3d5fbc8f8d75e4316 /gdb/arc-tdep.h
parent8aabe2e254e6a0419db9c6397c4068c69bfd95b0 (diff)
downloadgdb-ad0a504f7e10ea11dbf58eb9990a5180f781b695.zip
gdb-ad0a504f7e10ea11dbf58eb9990a5180f781b695.tar.gz
gdb-ad0a504f7e10ea11dbf58eb9990a5180f781b695.tar.bz2
arc: New Synopsys ARC port
ARC is a family of licensable processors developed by Synopsys. This is an initial patch that doesn't yet support some of the features, that are already available in Synopsys' fork of GDB, namely: * longjmp support * signal frame handling * prologue analysis * Linux targets support * native Linux support ARC cores are configurable and extensible, which means from debugger perspective that some registers and debug capabilities are optional, therefore it is up to the GDB stub to determine exact list of register available on target and supply it to GDB via XML target descriptions. List of registers that is known to GDB and is required is intentionally kept small to simplify requirements to GDB stub and implementation of a GDB client. gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Add arc-tdep.o. (HFILES_NO_SRCDIR): Add arc-tdep.h. (ALLDEPFILES): Add arc-tdep.c. * NEWS: Mention new ARC port. * configure.tgt: Add ARC. * arc-tdep.c: New file. * arc-tdep.h: New file. * features/Makefile (XMLTOC): Add arc-v2.xml and arc-arcompact.xml. * features/arc-v2.xml: New file. * features/arc-v2.c: New file (generated). * features/arc-arcompact.xml: New file. * features/arc-arcompact.c: New file (generated). gdb/doc/ChangeLog: * gdb.texinfo (Embedded Processors): Document ARC. (Synopsys ARC): New section. (Standard Target Features): Document ARC features. (ARC Features): New section. gdb/testsuite/ChangeLog: * gdb.xml/tdesc-regs.exp: set core-regs for arc*-*-elf32.
Diffstat (limited to 'gdb/arc-tdep.h')
-rw-r--r--gdb/arc-tdep.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h
new file mode 100644
index 0000000..1b2694b
--- /dev/null
+++ b/gdb/arc-tdep.h
@@ -0,0 +1,101 @@
+/* Target dependent code for ARC arhitecture, for GDB.
+
+ Copyright 2005-2016 Free Software Foundation, Inc.
+ Contributed by Synopsys Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef ARC_TDEP_H
+#define ARC_TDEP_H
+
+/* Need disassemble_info. */
+#include "dis-asm.h"
+
+enum arc_regnum
+ {
+ /* Core registers. */
+ ARC_R0_REGNUM = 0,
+ ARC_FIRST_CORE_REGNUM = ARC_R0_REGNUM,
+ ARC_R1_REGNUM = 1,
+ ARC_R4_REGNUM = 4,
+ ARC_R7_REGNUM = 7,
+ ARC_R9_REGNUM = 9,
+ ARC_R13_REGNUM = 13,
+ ARC_R16_REGNUM = 16,
+ ARC_R25_REGNUM = 25,
+ /* Global data pointer. */
+ ARC_GP_REGNUM,
+ /* Frame pointer. */
+ ARC_FP_REGNUM,
+ /* Stack pointer. */
+ ARC_SP_REGNUM,
+ /* Return address from interrupt. */
+ ARC_ILINK_REGNUM,
+ ARC_R30_REGNUM,
+ /* Return address from function. */
+ ARC_BLINK_REGNUM,
+ /* Zero-delay loop counter. */
+ ARC_LP_COUNT_REGNUM = 60,
+ /* Program counter, aligned to 4-bytes, read-only. */
+ ARC_PCL_REGNUM,
+ ARC_LAST_CORE_REGNUM = ARC_PCL_REGNUM,
+ /* AUX registers. */
+ /* Actual program counter. */
+ ARC_PC_REGNUM,
+ ARC_FIRST_AUX_REGNUM = ARC_PC_REGNUM,
+ /* Status register. */
+ ARC_STATUS32_REGNUM,
+ ARC_LAST_REGNUM = ARC_STATUS32_REGNUM,
+ ARC_LAST_AUX_REGNUM = ARC_STATUS32_REGNUM,
+
+ /* Additional ABI constants. */
+ ARC_FIRST_ARG_REGNUM = ARC_R0_REGNUM,
+ ARC_LAST_ARG_REGNUM = ARC_R7_REGNUM,
+ ARC_FIRST_CALLEE_SAVED_REGNUM = ARC_R13_REGNUM,
+ ARC_LAST_CALLEE_SAVED_REGNUM = ARC_R25_REGNUM,
+ };
+
+/* Number of bytes in ARC register. All ARC registers are considered 32-bit.
+ Those registers, which are actually shorter has zero-on-read for extra bits.
+ Longer registers are represented as pairs of 32-bit registers. */
+#define ARC_REGISTER_SIZE 4
+
+#define arc_print(fmt, args...) fprintf_unfiltered (gdb_stdlog, fmt, ##args)
+
+extern int arc_debug;
+
+/* Utility functions used by other ARC-specific modules. */
+
+static inline int
+arc_mach_is_arc600 (struct gdbarch *gdbarch)
+{
+ return (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc600
+ || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc601);
+}
+
+static inline int
+arc_mach_is_arc700 (struct gdbarch *gdbarch)
+{
+ return gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc700;
+}
+
+static inline int
+arc_mach_is_arcv2 (struct gdbarch *gdbarch)
+{
+ return gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arcv2;
+}
+
+#endif /* ARC_TDEP_H */