Skip to content

Commit

Permalink
gdb: new AndesTech NDS32 port
Browse files Browse the repository at this point in the history
gdb/ChangeLog:

	* Makefile.in (ALL_TARGET_OBS): Add nds32-tdep.o.
	(HFILES_NO_SRCDIR): Add nds32-tdep.h.
	(ALLDEPFILES): Add nds32-tdep.c.
	* NEWS: Mention new NDS32 port.
	* configure.tgt: Add NDS32.
	* nds32-tdep.c: New file.
	* nds32-tdep.h: New file.
	* features/Makefile (XMLTOC): Add nds32.xml.
	* features/nds32-core.xml: New file.
	* features/nds32-fpu.xml: New file.
	* features/nds32-system.xml: New file.
	* features/nds32.c: New file (generated).
	* features/nds32.xml: New file.

gdb/doc/ChangeLog:

	* gdb.texinfo (Standard Target Features): Document NDS32 features.
	(NDS32 Features): New Section.

gdb/testsuite/ChangeLog:

	* gdb.base/float.exp: Add target check for nds32*-*-*.
	* gdb.xml/tdesc-regs.exp: Set core-regs for nds32*-*-*.
  • Loading branch information
Yan-Ting Lin authored and patrick committed Jun 17, 2016
1 parent 96074ad commit a28d8e5
Show file tree
Hide file tree
Showing 17 changed files with 2,518 additions and 1 deletion.
16 changes: 16 additions & 0 deletions gdb/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2016-06-17 Yan-Ting Lin <[email protected]>

* Makefile.in (ALL_TARGET_OBS): Add nds32-tdep.o.
(HFILES_NO_SRCDIR): Add nds32-tdep.h.
(ALLDEPFILES): Add nds32-tdep.c.
* NEWS: Mention new NDS32 port.
* configure.tgt: Add NDS32.
* nds32-tdep.c: New file.
* nds32-tdep.h: New file.
* features/Makefile (XMLTOC): Add nds32.xml.
* features/nds32-core.xml: New file.
* features/nds32-fpu.xml: New file.
* features/nds32-system.xml: New file.
* features/nds32.c: New file (generated).
* features/nds32.xml: New file.

2016-06-14 John Baldwin <[email protected]>

* v850-tdep.c (v850_use_struct_convention): Trim type length checks.
Expand Down
4 changes: 3 additions & 1 deletion gdb/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ ALL_TARGET_OBS = \
moxie-tdep.o \
msp430-tdep.o \
mt-tdep.o \
nds32-tdep.o \
nios2-tdep.o nios2-linux-tdep.o \
nto-tdep.o \
ppc-linux-tdep.o ppcfbsd-tdep.o ppcnbsd-tdep.o ppcobsd-tdep.o \
Expand Down Expand Up @@ -967,7 +968,7 @@ amd64-darwin-tdep.h charset-list.h \
config/djgpp/langinfo.h config/djgpp/nl_types.h darwin-nat.h \
dicos-tdep.h filesystem.h gcore.h gdb_wchar.h hppabsd-tdep.h \
i386-darwin-tdep.h x86-nat.h linux-record.h moxie-tdep.h nios2-tdep.h \
ft32-tdep.h \
ft32-tdep.h nds32-tdep.h \
osdata.h procfs.h python/py-event.h python/py-events.h python/py-stopevent.h \
python/python-internal.h python/python.h ravenscar-thread.h record.h \
record-full.h solib-aix.h \
Expand Down Expand Up @@ -1726,6 +1727,7 @@ ALLDEPFILES = \
mipsnbsd-nat.c mipsnbsd-tdep.c \
mips64obsd-nat.c mips64obsd-tdep.c \
msp430-tdep.c \
nds32-tdep.c \
nios2-tdep.c nios2-linux-tdep.c \
nbsd-nat.c nbsd-tdep.c obsd-nat.c obsd-tdep.c \
posix-hdep.c common/posix-strerror.c \
Expand Down
4 changes: 4 additions & 0 deletions gdb/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ maint selftest

=record-started,thread-group="i1",method="btrace",format="bts"

* New targets

Andes NDS32 nds32*-*-elf

*** Changes in GDB 7.11

* GDB now supports debugging kernel-based threads on FreeBSD.
Expand Down
5 changes: 5 additions & 0 deletions gdb/configure.tgt
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ mt-*-*)
gdb_target_obs="mt-tdep.o"
;;

nds32*-*-elf)
# Target: AndesTech NDS32 core
gdb_target_obs="nds32-tdep.o"
;;

nios2*-*-linux*)
# Target: Altera Nios II running Linux
gdb_target_obs="nios2-tdep.o nios2-linux-tdep.o solib-svr4.o \
Expand Down
5 changes: 5 additions & 0 deletions gdb/doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2016-06-17 Yan-Ting Lin <[email protected]>

* gdb.texinfo (Standard Target Features): Document NDS32 features.
(NDS32 Features): New Section.

2016-06-09 Toshihito Kikuchi <[email protected]>

* gdb.texinfo (Examining Memory): Document negative repeat
Expand Down
23 changes: 23 additions & 0 deletions gdb/doc/gdb.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -40817,6 +40817,7 @@ registers using the capitalization used in the description.
* MicroBlaze Features::
* MIPS Features::
* M68K Features::
* NDS32 Features::
* Nios II Features::
* PowerPC Features::
* S/390 and System z Features::
Expand Down Expand Up @@ -41025,6 +41026,28 @@ This feature is optional. If present, it should contain registers
@samp{fpiaddr}.
@end table

@node NDS32 Features
@subsection NDS32 Features
@cindex target descriptions, NDS32 features

The @samp{org.gnu.gdb.nds32.core} feature is required for NDS32
targets. It should contain at least registers @samp{r0} through
@samp{r10}, @samp{r15}, @samp{fp}, @samp{gp}, @samp{lp}, @samp{sp},
and @samp{pc}.

The @samp{org.gnu.gdb.nds32.fpu} feature is optional. If present,
it should contain 64-bit double-precision floating-point registers
@samp{fd0} through @emph{fdN}, which should be @samp{fd3}, @samp{fd7},
@samp{fd15}, or @samp{fd31} based on the FPU configuration implemented.

@emph{Note:} The first sixteen 64-bit double-precision floating-point
registers are overlapped with the thirty-two 32-bit single-precision
floating-point registers. The 32-bit single-precision registers, if
not being listed explicitly, will be synthesized from halves of the
overlapping 64-bit double-precision registers. Listing 32-bit
single-precision registers explicitly is deprecated, and the
support to it could be totally removed some day.

@node Nios II Features
@subsection Nios II Features
@cindex target descriptions, Nios II features
Expand Down
1 change: 1 addition & 0 deletions gdb/features/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ XMLTOC = \
mips-linux.xml \
mips64-dsp-linux.xml \
mips64-linux.xml \
nds32.xml \
nios2-linux.xml \
nios2.xml \
rs6000/powerpc-32.xml \
Expand Down
44 changes: 44 additions & 0 deletions gdb/features/nds32-core.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2013-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 feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.nds32.core">
<reg name="r0" bitsize="32" regnum="0"/>
<reg name="r1" bitsize="32"/>
<reg name="r2" bitsize="32"/>
<reg name="r3" bitsize="32"/>
<reg name="r4" bitsize="32"/>
<reg name="r5" bitsize="32"/>
<reg name="r6" bitsize="32"/>
<reg name="r7" bitsize="32"/>
<reg name="r8" bitsize="32"/>
<reg name="r9" bitsize="32"/>
<reg name="r10" bitsize="32"/>
<reg name="r11" bitsize="32"/>
<reg name="r12" bitsize="32"/>
<reg name="r13" bitsize="32"/>
<reg name="r14" bitsize="32"/>
<reg name="r15" bitsize="32"/>
<reg name="r16" bitsize="32"/>
<reg name="r17" bitsize="32"/>
<reg name="r18" bitsize="32"/>
<reg name="r19" bitsize="32"/>
<reg name="r20" bitsize="32"/>
<reg name="r21" bitsize="32"/>
<reg name="r22" bitsize="32"/>
<reg name="r23" bitsize="32"/>
<reg name="r24" bitsize="32"/>
<reg name="r25" bitsize="32"/>
<reg name="r26" bitsize="32"/>
<reg name="r27" bitsize="32"/>
<reg name="fp" bitsize="32" type="data_ptr"/>
<reg name="gp" bitsize="32" type="data_ptr"/>
<reg name="lp" bitsize="32" type="code_ptr"/>
<reg name="sp" bitsize="32" type="data_ptr"/>

<reg name="pc" bitsize="32" type="code_ptr"/>
</feature>
42 changes: 42 additions & 0 deletions gdb/features/nds32-fpu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2013-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 feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.nds32.fpu">
<reg name="fd0" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd1" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd2" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd3" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd4" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd5" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd6" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd7" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd8" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd9" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd10" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd11" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd12" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd13" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd14" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd15" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd16" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd17" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd18" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd19" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd20" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd21" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd22" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd23" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd24" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd25" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd26" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd27" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd28" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd29" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd30" bitsize="64" type="ieee_double" group="float"/>
<reg name="fd31" bitsize="64" type="ieee_double" group="float"/>
</feature>
14 changes: 14 additions & 0 deletions gdb/features/nds32-system.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2013-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 feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.nds32.system">
<reg name="ir0" bitsize="32"/>

<reg name="itb" bitsize="32"/>
<reg name="ifc_lp" bitsize="32"/>
</feature>
92 changes: 92 additions & 0 deletions gdb/features/nds32.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
Original: nds32.xml */

#include "defs.h"
#include "osabi.h"
#include "target-descriptions.h"

struct target_desc *tdesc_nds32;
static void
initialize_tdesc_nds32 (void)
{
struct target_desc *result = allocate_target_description ();
struct tdesc_feature *feature;

set_tdesc_architecture (result, bfd_scan_arch ("n1h"));

feature = tdesc_create_feature (result, "org.gnu.gdb.nds32.core");
tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
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, "int");
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, "fp", 28, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "gp", 29, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "lp", 30, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "sp", 31, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "pc", 32, 1, NULL, 32, "code_ptr");

feature = tdesc_create_feature (result, "org.gnu.gdb.nds32.fpu");
tdesc_create_reg (feature, "fd0", 33, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd1", 34, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd2", 35, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd3", 36, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd4", 37, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd5", 38, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd6", 39, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd7", 40, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd8", 41, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd9", 42, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd10", 43, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd11", 44, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd12", 45, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd13", 46, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd14", 47, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd15", 48, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd16", 49, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd17", 50, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd18", 51, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd19", 52, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd20", 53, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd21", 54, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd22", 55, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd23", 56, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd24", 57, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd25", 58, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd26", 59, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd27", 60, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd28", 61, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd29", 62, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd30", 63, 1, "float", 64, "ieee_double");
tdesc_create_reg (feature, "fd31", 64, 1, "float", 64, "ieee_double");

feature = tdesc_create_feature (result, "org.gnu.gdb.nds32.system");
tdesc_create_reg (feature, "ir0", 65, 1, NULL, 32, "int");
tdesc_create_reg (feature, "itb", 66, 1, NULL, 32, "int");
tdesc_create_reg (feature, "ifc_lp", 67, 1, NULL, 32, "int");

tdesc_nds32 = result;
}
14 changes: 14 additions & 0 deletions gdb/features/nds32.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2013-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>nds32</architecture>
<xi:include href="nds32-core.xml"/>
<xi:include href="nds32-fpu.xml"/>
<xi:include href="nds32-system.xml"/>
</target>
Loading

0 comments on commit a28d8e5

Please sign in to comment.