summaryrefslogtreecommitdiff
path: root/gdb/features
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2017-12-09 05:57:25 +0900
committerStafford Horne <shorne@gmail.com>2017-12-12 23:36:00 +0900
commita994fec4f8f7a886be61cfb3023c354cd2483b9d (patch)
treea95c3f3bdea6b9a51ddffd2c74d7a7286cf41e25 /gdb/features
parentdb9077b7275e86637218a7a7d165cb85a4de116f (diff)
downloadbinutils-gdb-a994fec4f8f7a886be61cfb3023c354cd2483b9d.tar.gz
gdb: Add OpenRISC or1k and or1knd target support
This patch prepares the current GDB port of the OpenRISC processor from https://github.com/openrisc/binutils-gdb for upstream merging. Testing has been done with a cgen sim provided in a separate patch. This has been tested with 2 toolchains. GCC [1] 5.4.0 from the OpenRISC project with Newlib [2] and GCC 5.4.0 with Musl [3] 1.1.4. It supports or1knd (no delay slot target). The default target is or1k (with delay slot). You can change the target arch with: (gdb) set architecture or1knd The target architecture is assumed to be or1knd [1] https://github.com/openrisc/or1k-gcc [2] https://github.com/openrisc/newlib [3] https://github.com/openrisc/musl-cross gdb/doc/ChangeLog: 2017-12-12 Stafford Horne <shorne@gmail.com> Stefan Wallentowitz <stefan@wallentowitz.de> Franck Jullien <franck.jullien@gmail.com> Jeremy Bennett <jeremy.bennett@embecosm.com> * gdb.texinfo: Add OpenRISC documentation. gdb/ChangeLog: 2017-12-12 Stafford Horne <shorne@gmail.com> Stefan Wallentowitz <stefan@wallentowitz.de> Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Franck Jullien <franck.jullien@gmail.com> Jeremy Bennett <jeremy.bennett@embecosm.com> * configure.tgt: Add targets for or1k and or1knd. * or1k-tdep.c: New file. * or1k-tdep.h: New file. * features/Makefile: Add or1k.xml to build. * features/or1k.xml: New file. * features/or1k-core.xml: New file. * features/or1k.c: Generated.
Diffstat (limited to 'gdb/features')
-rw-r--r--gdb/features/Makefile2
-rw-r--r--gdb/features/or1k-core.xml65
-rw-r--r--gdb/features/or1k.c77
-rw-r--r--gdb/features/or1k.xml12
4 files changed, 156 insertions, 0 deletions
diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index 73be34c313f..c78349eba93 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -93,6 +93,7 @@ mips64-expedite = r29,pc
mips64-dsp-expedite = r29,pc
microblaze-expedite = r1,rpc
nios2-linux-expedite = sp,pc
+or1k-expedite = r1,npc
powerpc-expedite = r1,pc
rs6000/powerpc-cell32l-expedite = r1,pc,r0,orig_r3,r4
rs6000/powerpc-cell64l-expedite = r1,pc,r0,orig_r3,r4
@@ -136,6 +137,7 @@ XMLTOC = \
mips64-linux.xml \
nds32.xml \
nios2.xml \
+ or1k.xml \
rs6000/powerpc-32.xml \
rs6000/powerpc-32l.xml \
rs6000/powerpc-403.xml \
diff --git a/gdb/features/or1k-core.xml b/gdb/features/or1k-core.xml
new file mode 100644
index 00000000000..1a9673d6c2b
--- /dev/null
+++ b/gdb/features/or1k-core.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2017 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.or1k.group0">
+ <reg name="r0" bitsize="32" type="int"/>
+ <reg name="r1" bitsize="32" type="data_ptr"/>
+ <reg name="r2" bitsize="32" type="data_ptr"/>
+ <reg name="r3" bitsize="32" type="int"/>
+ <reg name="r4" bitsize="32" type="int"/>
+ <reg name="r5" bitsize="32" type="int"/>
+ <reg name="r6" bitsize="32" type="int"/>
+ <reg name="r7" bitsize="32" type="int"/>
+ <reg name="r8" bitsize="32" type="int"/>
+ <reg name="r9" bitsize="32" type="code_ptr"/>
+ <reg name="r10" bitsize="32" type="int"/>
+ <reg name="r11" bitsize="32" type="int"/>
+ <reg name="r12" bitsize="32" type="int"/>
+ <reg name="r13" bitsize="32" type="int"/>
+ <reg name="r14" bitsize="32" type="int"/>
+ <reg name="r15" bitsize="32" type="int"/>
+ <reg name="r16" bitsize="32" type="int"/>
+ <reg name="r17" bitsize="32" type="int"/>
+ <reg name="r18" bitsize="32" type="int"/>
+ <reg name="r19" bitsize="32" type="int"/>
+ <reg name="r20" bitsize="32" type="int"/>
+ <reg name="r21" bitsize="32" type="int"/>
+ <reg name="r22" bitsize="32" type="int"/>
+ <reg name="r23" bitsize="32" type="int"/>
+ <reg name="r24" bitsize="32" type="int"/>
+ <reg name="r25" bitsize="32" type="int"/>
+ <reg name="r26" bitsize="32" type="int"/>
+ <reg name="r27" bitsize="32" type="int"/>
+ <reg name="r28" bitsize="32" type="int"/>
+ <reg name="r29" bitsize="32" type="int"/>
+ <reg name="r30" bitsize="32" type="int"/>
+ <reg name="r31" bitsize="32" type="int"/>
+ <reg name="ppc" bitsize="32" type="code_ptr"/>
+ <reg name="npc" bitsize="32" type="code_ptr"/>
+ <flags id="sr_flags" size="4">
+ <field name="SM" start="0" end="0"/>
+ <field name="TEE" start="1" end="1"/>
+ <field name="IEE" start="2" end="2"/>
+ <field name="DCE" start="3" end="3"/>
+ <field name="ICE" start="4" end="4"/>
+ <field name="DME" start="5" end="5"/>
+ <field name="IME" start="6" end="6"/>
+ <field name="LEE" start="7" end="7"/>
+ <field name="CE" start="8" end="8"/>
+ <field name="F" start="9" end="9"/>
+ <field name="CY" start="10" end="10"/>
+ <field name="OV" start="11" end="11"/>
+ <field name="OVE" start="12" end="12"/>
+ <field name="DSX" start="13" end="13"/>
+ <field name="EPH" start="14" end="14"/>
+ <field name="FO" start="15" end="15"/>
+ <field name="SUMRA" start="16" end="16"/>
+ <field name="CID" start="28" end="31"/>
+ </flags>
+ <reg name="sr" bitsize="32" type="sr_flags"/>
+</feature>
diff --git a/gdb/features/or1k.c b/gdb/features/or1k.c
new file mode 100644
index 00000000000..929a5f92089
--- /dev/null
+++ b/gdb/features/or1k.c
@@ -0,0 +1,77 @@
+/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
+ Original: or1k.xml */
+
+#include "defs.h"
+#include "osabi.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_or1k;
+static void
+initialize_tdesc_or1k (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ set_tdesc_architecture (result, bfd_scan_arch ("or1k"));
+
+ struct tdesc_feature *feature;
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.or1k.group0");
+ tdesc_type_with_fields *type_with_fields;
+ tdesc_type *field_type;
+ type_with_fields = tdesc_create_flags (feature, "sr_flags", 4);
+ tdesc_add_flag (type_with_fields, 0, "SM");
+ tdesc_add_flag (type_with_fields, 1, "TEE");
+ tdesc_add_flag (type_with_fields, 2, "IEE");
+ tdesc_add_flag (type_with_fields, 3, "DCE");
+ tdesc_add_flag (type_with_fields, 4, "ICE");
+ tdesc_add_flag (type_with_fields, 5, "DME");
+ tdesc_add_flag (type_with_fields, 6, "IME");
+ tdesc_add_flag (type_with_fields, 7, "LEE");
+ tdesc_add_flag (type_with_fields, 8, "CE");
+ tdesc_add_flag (type_with_fields, 9, "F");
+ tdesc_add_flag (type_with_fields, 10, "CY");
+ tdesc_add_flag (type_with_fields, 11, "OV");
+ tdesc_add_flag (type_with_fields, 12, "OVE");
+ tdesc_add_flag (type_with_fields, 13, "DSX");
+ tdesc_add_flag (type_with_fields, 14, "EPH");
+ tdesc_add_flag (type_with_fields, 15, "FO");
+ tdesc_add_flag (type_with_fields, 16, "SUMRA");
+ tdesc_add_bitfield (type_with_fields, "CID", 28, 31);
+
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "ppc", 32, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "npc", 33, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "sr", 34, 1, NULL, 32, "sr_flags");
+
+ tdesc_or1k = result;
+}
diff --git a/gdb/features/or1k.xml b/gdb/features/or1k.xml
new file mode 100644
index 00000000000..c138a02e6b4
--- /dev/null
+++ b/gdb/features/or1k.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2016 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>or1k</architecture>
+ <xi:include href="or1k-core.xml"/>
+</target>