2013-05-06 Sandra Loosemore <sandra@codesourcery.com>

Andrew Jenner  <andrew@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	Based on the nios2-elf port from Altera Corporation.

	gdb/
	* Makefile.in (ALL_TARGET_OBS): Add nios2-tdep.o and
	nios2-linux-tdep.o.
	(HFILES_NO_SRCDIR): Add nios2-tdep.h.
	(ALLDEPFILES): Add nios2-tdep.c and nios2-linux-tdep.c.
	* configure.tgt: Add nios2*-*-linux* and nios2*-*-* targets.
	* nios2-tdep.h: New.
	* nios2-tdep.c: New.
	* nios2-linux-tdep.c: New.
	* features/Makefile (WHICH): Add nios2-linux.
	(nios2-linux-expedite): Set.
	* features/nios2-cpu.xml: New.
	* features/nios2.xml: New.
	* features/nios2-linux.xml: New.
	* features/nios2.c: New (autogenerated).
	* features/nios2-linux.c: New (autogenerated).
	* regformats/nios2-linux.dat: New (autogenerated).
	* NEWS (Changes since GDB 7.6): Add new Nios II targets
	and commands.

	gdb/doc/
	* gdb.texinfo (Nios II): New section.
	(Nios II Features): New section.
This commit is contained in:
Sandra Loosemore 2013-05-07 01:09:29 +00:00
parent 3b7bacacfd
commit a1217d97c4
16 changed files with 2313 additions and 1 deletions

View file

@ -42,6 +42,7 @@ WHICH = aarch64 aarch64-without-fpu \
i386/x32-avx i386/x32-avx-linux \
mips-linux mips-dsp-linux \
mips64-linux mips64-dsp-linux \
nios2-linux \
rs6000/powerpc-32 \
rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \
rs6000/powerpc-64l rs6000/powerpc-altivec64l rs6000/powerpc-vsx32l \
@ -73,6 +74,7 @@ mips-expedite = r29,pc
mips-dsp-expedite = r29,pc
mips64-expedite = r29,pc
mips64-dsp-expedite = r29,pc
nios2-linux-expedite = sp,pc
powerpc-expedite = r1,pc
rs6000/powerpc-cell32l-expedite = r1,pc,r0,orig_r3,r4
rs6000/powerpc-cell64l-expedite = r1,pc,r0,orig_r3,r4

View file

@ -0,0 +1,59 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2012-2013 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.nios2.cpu">
<reg name="zero" bitsize="32" type="uint32"/>
<reg name="at" bitsize="32" type="uint32"/>
<reg name="r2" bitsize="32" type="uint32"/>
<reg name="r3" bitsize="32" type="uint32"/>
<reg name="r4" bitsize="32" type="uint32"/>
<reg name="r5" bitsize="32" type="uint32"/>
<reg name="r6" bitsize="32" type="uint32"/>
<reg name="r7" bitsize="32" type="uint32"/>
<reg name="r8" bitsize="32" type="uint32"/>
<reg name="r9" bitsize="32" type="uint32"/>
<reg name="r10" bitsize="32" type="uint32"/>
<reg name="r11" bitsize="32" type="uint32"/>
<reg name="r12" bitsize="32" type="uint32"/>
<reg name="r13" bitsize="32" type="uint32"/>
<reg name="r14" bitsize="32" type="uint32"/>
<reg name="r15" bitsize="32" type="uint32"/>
<reg name="r16" bitsize="32" type="uint32"/>
<reg name="r17" bitsize="32" type="uint32"/>
<reg name="r18" bitsize="32" type="uint32"/>
<reg name="r19" bitsize="32" type="uint32"/>
<reg name="r20" bitsize="32" type="uint32"/>
<reg name="r21" bitsize="32" type="uint32"/>
<reg name="r22" bitsize="32" type="uint32"/>
<reg name="r23" bitsize="32" type="uint32"/>
<reg name="et" bitsize="32" type="uint32"/>
<reg name="bt" bitsize="32" type="uint32"/>
<reg name="gp" bitsize="32" type="uint32"/>
<reg name="sp" bitsize="32" type="data_ptr"/>
<reg name="fp" bitsize="32" type="uint32"/>
<reg name="ea" bitsize="32" type="uint32"/>
<reg name="ba" bitsize="32" type="uint32"/>
<reg name="ra" bitsize="32" type="uint32"/>
<reg name="pc" bitsize="32" type="code_ptr"/>
<reg name="status" bitsize="32" type="uint32"/>
<reg name="estatus" bitsize="32" type="uint32"/>
<reg name="bstatus" bitsize="32" type="uint32"/>
<reg name="ienable" bitsize="32" type="uint32"/>
<reg name="ipending" bitsize="32" type="uint32"/>
<reg name="cpuid" bitsize="32" type="uint32"/>
<reg name="ctl6" bitsize="32" type="uint32"/>
<reg name="exception" bitsize="32" type="uint32"/>
<reg name="pteaddr" bitsize="32" type="uint32"/>
<reg name="tlbacc" bitsize="32" type="uint32"/>
<reg name="tlbmisc" bitsize="32" type="uint32"/>
<reg name="eccinj" bitsize="32" type="uint32"/>
<reg name="badaddr" bitsize="32" type="uint32"/>
<reg name="config" bitsize="32" type="uint32"/>
<reg name="mpubase" bitsize="32" type="uint32"/>
<reg name="mpuacc" bitsize="32" type="uint32"/>
</feature>

View file

@ -0,0 +1,71 @@
/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
Original: nios2-linux.xml */
#include "defs.h"
#include "osabi.h"
#include "target-descriptions.h"
struct target_desc *tdesc_nios2_linux;
static void
initialize_tdesc_nios2_linux (void)
{
struct target_desc *result = allocate_target_description ();
struct tdesc_feature *feature;
set_tdesc_architecture (result, bfd_scan_arch ("nios2"));
set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
feature = tdesc_create_feature (result, "org.gnu.gdb.nios2.cpu");
tdesc_create_reg (feature, "zero", 0, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "at", 1, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "et", 24, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "bt", 25, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "sp", 27, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ba", 30, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "pc", 32, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "status", 33, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "estatus", 34, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "bstatus", 35, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ienable", 36, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ipending", 37, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "cpuid", 38, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ctl6", 39, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "exception", 40, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "pteaddr", 41, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "tlbacc", 42, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "tlbmisc", 43, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "eccinj", 44, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "badaddr", 45, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "config", 46, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "mpubase", 47, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "mpuacc", 48, 1, NULL, 32, "uint32");
tdesc_nios2_linux = result;
}

View file

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2012-2013 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>nios2</architecture>
<osabi>GNU/Linux</osabi>
<xi:include href="nios2-cpu.xml"/>
</target>

69
gdb/features/nios2.c Normal file
View file

@ -0,0 +1,69 @@
/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
Original: nios2.xml */
#include "defs.h"
#include "osabi.h"
#include "target-descriptions.h"
struct target_desc *tdesc_nios2;
static void
initialize_tdesc_nios2 (void)
{
struct target_desc *result = allocate_target_description ();
struct tdesc_feature *feature;
set_tdesc_architecture (result, bfd_scan_arch ("nios2"));
feature = tdesc_create_feature (result, "org.gnu.gdb.nios2.cpu");
tdesc_create_reg (feature, "zero", 0, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "at", 1, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "et", 24, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "bt", 25, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "sp", 27, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ba", 30, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "pc", 32, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "status", 33, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "estatus", 34, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "bstatus", 35, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ienable", 36, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ipending", 37, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "cpuid", 38, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "ctl6", 39, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "exception", 40, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "pteaddr", 41, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "tlbacc", 42, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "tlbmisc", 43, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "eccinj", 44, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "badaddr", 45, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "config", 46, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "mpubase", 47, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "mpuacc", 48, 1, NULL, 32, "uint32");
tdesc_nios2 = result;
}

12
gdb/features/nios2.xml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2013 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>nios2</architecture>
<xi:include href="nios2-cpu.xml"/>
</target>