diff options
author | dim <dim@FreeBSD.org> | 2010-11-11 20:52:24 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-11-11 20:52:24 +0000 |
commit | 37e50857240f22fdc2beb83a5bf670c44a94212d (patch) | |
tree | 9a6496b320a182a536b4a33b916ab30b48840f06 /gnu/usr.bin | |
parent | cfbe0682af24afabd3a5a9652758cf3ef046843b (diff) | |
parent | 56b80da7cac820e4575a4eca93a1c13c386ccec5 (diff) | |
download | FreeBSD-src-37e50857240f22fdc2beb83a5bf670c44a94212d.zip FreeBSD-src-37e50857240f22fdc2beb83a5bf670c44a94212d.tar.gz |
Sync: merge r214895 through r215140 from ^/head.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/binutils/Makefile.inc0 | 31 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/as/Makefile | 6 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/ld/Makefile.arm | 2 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/ld/Makefile.mips | 4 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/libbfd/Makefile.arm | 4 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/libbfd/Makefile.mips | 6 | ||||
-rw-r--r-- | gnu/usr.bin/cc/Makefile.inc | 10 | ||||
-rw-r--r-- | gnu/usr.bin/cc/Makefile.tgt | 19 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_int/Makefile | 4 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_tools/Makefile | 22 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/Makefile.inc | 14 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/arch/mips/Makefile | 2 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/arch/mips/init.c | 5 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/Makefile | 2 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/trgt_mips.c | 41 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/libgdb/Makefile | 10 |
16 files changed, 105 insertions, 77 deletions
diff --git a/gnu/usr.bin/binutils/Makefile.inc0 b/gnu/usr.bin/binutils/Makefile.inc0 index 7a062ba..09bda29 100644 --- a/gnu/usr.bin/binutils/Makefile.inc0 +++ b/gnu/usr.bin/binutils/Makefile.inc0 @@ -6,15 +6,19 @@ VERSION= "2.17.50 [FreeBSD] 2007-07-03" +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif TARGET_ARCH?= ${MACHINE_ARCH} TARGET_VENDOR?= unknown TARGET_OS?= freebsd -.if ${TARGET_ARCH} == "amd64" -BINUTILS_ARCH=x86_64 -.else -BINUTILS_ARCH=${TARGET_ARCH} -.endif +BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/} TARGET_TUPLE?= ${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS} +.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb" +TARGET_BIG_ENDIAN=t +.endif # RELTOP is the relative path to this point in the source or object # tree, from any subdirectory of same. It gets extra "../" prefixes @@ -24,28 +28,29 @@ RELTOP:= .. RELSRC= ${RELTOP}/../../../contrib/binutils SRCDIR= ${.CURDIR}/${RELSRC} -.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || \ - ${TARGET_ARCH} == "powerpc" || \ - (${TARGET_ARCH} == "mips" && (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \ + ${TARGET_CPUARCH} == "powerpc" || \ + (${TARGET_CPUARCH} == "mips" && \ + (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 .else CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64 .endif CFLAGS+= -I. -.if exists(${.CURDIR}/${TARGET_ARCH}) -CFLAGS+= -I${.CURDIR}/${TARGET_ARCH} +.if exists(${.CURDIR}/${TARGET_CPUARCH}) +CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH} .endif CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd CFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd CFLAGS+= -I${SRCDIR}/include -.if exists(${.CURDIR}/${TARGET_ARCH}) -.PATH: ${.CURDIR}/${TARGET_ARCH} +.if exists(${.CURDIR}/${TARGET_CPUARCH}) +.PATH: ${.CURDIR}/${TARGET_CPUARCH} .endif -ARCHS= ${TARGET_ARCH} +ARCHS= ${TARGET_CPUARCH} .for _arch in ${CROSS_ARCH} .if (${ARCHS:R:M${_arch:R}} == "") diff --git a/gnu/usr.bin/binutils/as/Makefile b/gnu/usr.bin/binutils/as/Makefile index 7e2df54..003ce1f 100644 --- a/gnu/usr.bin/binutils/as/Makefile +++ b/gnu/usr.bin/binutils/as/Makefile @@ -41,7 +41,7 @@ SRCS+= app.c \ # DEO: why not used? #SRCS+= itbl-ops.c -.if ${TARGET_ARCH} == "mips" +.if ${TARGET_CPUARCH} == "mips" SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l .endif @@ -52,7 +52,7 @@ SRCS+= tc-ppc.c .elif ${TARGET_ARCH} == "sparc64" SRCS+= tc-sparc.c .else -SRCS+= tc-${TARGET_ARCH}.c +SRCS+= tc-${TARGET_CPUARCH}.c .endif .if ${TARGET_ARCH} == "sparc64" @@ -70,7 +70,7 @@ CFLAGS+= -DTARGET_ALIAS=\"${TARGET_TUPLE}\" CFLAGS+= -DVERSION=\"${VERSION}\" CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${SRCDIR}/gas -I${SRCDIR}/bfd -I${SRCDIR}/gas/config -I${SRCDIR} -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_ARCH}-freebsd +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd NO_SHARED?= yes diff --git a/gnu/usr.bin/binutils/ld/Makefile.arm b/gnu/usr.bin/binutils/ld/Makefile.arm index b4d9d69..870fcec 100644 --- a/gnu/usr.bin/binutils/ld/Makefile.arm +++ b/gnu/usr.bin/binutils/ld/Makefile.arm @@ -1,6 +1,6 @@ # $FreeBSD$ -.if defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" NATIVE_EMULATION= armelfb_fbsd .else NATIVE_EMULATION= armelf_fbsd diff --git a/gnu/usr.bin/binutils/ld/Makefile.mips b/gnu/usr.bin/binutils/ld/Makefile.mips index e0d0582..de0ec94 100644 --- a/gnu/usr.bin/binutils/ld/Makefile.mips +++ b/gnu/usr.bin/binutils/ld/Makefile.mips @@ -1,8 +1,6 @@ # $FreeBSD$ -#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention -# of mipsel and mips. -.if !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "mipsel" _EMULATION_ENDIAN=l .else _EMULATION_ENDIAN=b diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.arm b/gnu/usr.bin/binutils/libbfd/Makefile.arm index 9633783..4910f38 100644 --- a/gnu/usr.bin/binutils/libbfd/Makefile.arm +++ b/gnu/usr.bin/binutils/libbfd/Makefile.arm @@ -1,6 +1,6 @@ # $FreeBSD$ -.if defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" DEFAULT_VECTOR= bfd_elf32_bigarm_vec .else DEFAULT_VECTOR= bfd_elf32_littlearm_vec @@ -14,7 +14,7 @@ SRCS+= cpu-arm.c \ elflink.c VECS+= ${DEFAULT_VECTOR} -.if defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" VECS+= bfd_elf32_littlearm_vec .else VECS+= bfd_elf32_bigarm_vec diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.mips b/gnu/usr.bin/binutils/libbfd/Makefile.mips index cb1e370..bf21130 100644 --- a/gnu/usr.bin/binutils/libbfd/Makefile.mips +++ b/gnu/usr.bin/binutils/libbfd/Makefile.mips @@ -1,15 +1,11 @@ # $FreeBSD$ -#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention -# of mipsel and mips. -.if !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "mipsel" _EMULATION_ENDIAN=little .else _EMULATION_ENDIAN=big .endif -DEFAULT_VECTOR= bfd_elf32_tradbigmips_vec - .if defined(TARGET_ABI) && ${TARGET_ABI} != "o32" .if ${TARGET_ABI} == "n32" DEFAULT_VECTOR= bfd_elf32_ntrad${_EMULATION_ENDIAN}mips_vec diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc index 994d979..9d3ee2d 100644 --- a/gnu/usr.bin/cc/Makefile.inc +++ b/gnu/usr.bin/cc/Makefile.inc @@ -32,9 +32,13 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE} CFLAGS+= -DCROSS_COMPILE .endif -.if ${TARGET_ARCH} == "mips" -# XXX This is backwards, MIPS should default to BE. -.if !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" +CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END +.endif + + +.if ${TARGET_CPUARCH} == "mips" +.if ${TARGET_ARCH} == "mipsel" CFLAGS += -DTARGET_ENDIAN_DEFAULT=0 .endif diff --git a/gnu/usr.bin/cc/Makefile.tgt b/gnu/usr.bin/cc/Makefile.tgt index 5e036bc..a1e6d08 100644 --- a/gnu/usr.bin/cc/Makefile.tgt +++ b/gnu/usr.bin/cc/Makefile.tgt @@ -1,16 +1,15 @@ # $FreeBSD$ -TARGET_ARCH?= ${MACHINE_ARCH} +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... -.if ${TARGET_ARCH} == "amd64" -GCC_CPU= i386 -.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" -GCC_CPU= rs6000 -.elif ${TARGET_ARCH} == "sparc64" -GCC_CPU= sparc +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} .else -GCC_CPU= ${TARGET_ARCH} +TARGET_CPUARCH=${MACHINE_CPUARCH} .endif +TARGET_ARCH?= ${MACHINE_ARCH} +GCC_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/} .if ${TARGET_ARCH} == "ia64" TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD @@ -18,7 +17,9 @@ TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD .if ${TARGET_ARCH} == "sparc64" TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc .endif +.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb" || ${TARGET_ARCH} == "mips64eb" +TARGET_BIG_ENDIAN=t +.endif .if ${TARGET_ARCH} == "powerpc64" TARGET_CPU_DEFAULT= \"powerpc64\" .endif - diff --git a/gnu/usr.bin/cc/cc_int/Makefile b/gnu/usr.bin/cc/cc_int/Makefile index a7ec17c..7082c3e 100644 --- a/gnu/usr.bin/cc/cc_int/Makefile +++ b/gnu/usr.bin/cc/cc_int/Makefile @@ -75,10 +75,6 @@ OBJS-md+= ${GCC_CPU}-c.o # Target specific, C specific object file C_TARGET_OBJS= -.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) -CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END -.endif - # Language-specific object files for C and Objective C. C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \ c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \ diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile index 87ad642..1ba2300 100644 --- a/gnu/usr.bin/cc/cc_tools/Makefile +++ b/gnu/usr.bin/cc/cc_tools/Makefile @@ -22,13 +22,13 @@ LIBIBERTY= libiberty.a # The list of headers to go into tm.h # TARGET_INC+= options.h -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= i386/biarch64.h .endif -.if ${TARGET_ARCH} != "arm" +.if ${TARGET_CPUARCH} != "arm" TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h .endif -.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/unix.h TARGET_INC+= ${GCC_CPU}/att.h .endif @@ -38,18 +38,18 @@ TARGET_INC+= elfos.h TARGET_INC+= freebsd-native.h TARGET_INC+= freebsd-spec.h TARGET_INC+= freebsd.h -.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64" +.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" . if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) TARGET_INC+= ${GCC_CPU}/sysv4.h . endif .endif -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/x86-64.h .endif -.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "mips" +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" TARGET_INC+= ${GCC_CPU}/elf.h .endif -.if ${TARGET_ARCH} == "arm" +.if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/aout.h .endif .if ${TARGET_ARCH} == "powerpc64" @@ -57,10 +57,10 @@ TARGET_INC+= ${GCC_CPU}/biarch64.h TARGET_INC+= ${GCC_CPU}/default64.h .endif TARGET_INC+= ${GCC_CPU}/freebsd.h -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/freebsd64.h .endif -.if ${TARGET_ARCH} == "arm" +.if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/arm.h .endif TARGET_INC+= defaults.h @@ -175,11 +175,11 @@ OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt .endif -.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" +.if ${TARGET_CPUARCH} == "powerpc" OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt .endif -.if ${TARGET_ARCH} == "sparc64" +.if ${TARGET_CPUARCH} == "sparc64" OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt .endif diff --git a/gnu/usr.bin/gdb/Makefile.inc b/gnu/usr.bin/gdb/Makefile.inc index c230f95..2888163 100644 --- a/gnu/usr.bin/gdb/Makefile.inc +++ b/gnu/usr.bin/gdb/Makefile.inc @@ -16,8 +16,16 @@ OBJ_ROOT= ${.OBJDIR}/../.. OBJ_BU= ${OBJ_ROOT}/binutils OBJ_GDB= ${OBJ_ROOT}/gdb -TARGET_ARCH?= ${MACHINE_ARCH} -TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_ARCH} +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... + +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif +TARGET_ARCH?= ${MACHINE_ARCH} +TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_CPUARCH} .if ${TARGET_ARCH} != ${MACHINE_ARCH} GDB_CROSS_DEBUGGER= @@ -31,7 +39,7 @@ GDB_CROSS_DEBUGGER= CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} -CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_ARCH} +CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH} CFLAGS+= -I${CNTRB_GDB}/gdb CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include diff --git a/gnu/usr.bin/gdb/arch/mips/Makefile b/gnu/usr.bin/gdb/arch/mips/Makefile index 54180d9..a6d4d9e 100644 --- a/gnu/usr.bin/gdb/arch/mips/Makefile +++ b/gnu/usr.bin/gdb/arch/mips/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) -LIBSRCS+= mipsfbsd-nat.c +LIBSRCS+= mipsfbsd-nat.c fbsd-threads.c .endif LIBSRCS+= solib.c solib-svr4.c LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c fbsd-proc.c diff --git a/gnu/usr.bin/gdb/arch/mips/init.c b/gnu/usr.bin/gdb/arch/mips/init.c index 27631f2..491b2b3 100644 --- a/gnu/usr.bin/gdb/arch/mips/init.c +++ b/gnu/usr.bin/gdb/arch/mips/init.c @@ -119,6 +119,8 @@ initialize_all_files (void) _initialize_mips_tdep (); _initialize_mipsfbsd_tdep (); _initialize_corelow (); + _initialize_solib (); + _initialize_svr4_solib (); _initialize_ser_hardwire (); _initialize_ser_pipe (); _initialize_ser_tcp (); @@ -130,8 +132,7 @@ initialize_all_files (void) _initialize_kernel_u_addr (); _initialize_infptrace (); _initialize_inftarg (); - _initialize_solib (); - _initialize_svr4_solib (); + _initialize_thread_db (); #if 0 _initialize_svr4_lm (); #endif diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile index 955394a..1372f17 100644 --- a/gnu/usr.bin/gdb/kgdb/Makefile +++ b/gnu/usr.bin/gdb/kgdb/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= kgdb${GDB_SUFFIX} -SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_ARCH}.c +SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c WARNS?= 2 BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ diff --git a/gnu/usr.bin/gdb/kgdb/trgt_mips.c b/gnu/usr.bin/gdb/kgdb/trgt_mips.c index 9782222..423cacd 100644 --- a/gnu/usr.bin/gdb/kgdb/trgt_mips.c +++ b/gnu/usr.bin/gdb/kgdb/trgt_mips.c @@ -46,11 +46,16 @@ __FBSDID("$FreeBSD$"); #include <frame-unwind.h> #include <mips-tdep.h> +#ifndef CROSS_DEBUGGER +#include <machine/pcb.h> +#endif + #include "kgdb.h" void kgdb_trgt_fetch_registers(int regno __unused) { +#ifndef CROSS_DEBUGGER struct kthr *kt; struct pcb pcb; @@ -61,24 +66,27 @@ kgdb_trgt_fetch_registers(int regno __unused) warnx("kvm_read: %s", kvm_geterr(kvm)); memset(&pcb, 0, sizeof(pcb)); } - supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[0]); - supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[1]); - supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[2]); - supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[3]); - supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[4]); - supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[5]); - supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[6]); - supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[7]); - supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[8]); - supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[9]); - supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[10]); + + supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S0]); + supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S1]); + supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S2]); + supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S3]); + supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S4]); + supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S5]); + supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S6]); + supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S7]); + supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_SP]); + supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]); + supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]); + supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]); +#endif } void kgdb_trgt_store_registers(int regno __unused) { - fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__); + fprintf_unfiltered(gdb_stderr, "Unimplemented function: %s\n", __func__); } void @@ -86,6 +94,7 @@ kgdb_trgt_new_objfile(struct objfile *objfile) { } +#ifndef CROSS_DEBUGGER struct kgdb_frame_cache { CORE_ADDR pc; CORE_ADDR sp; @@ -127,7 +136,7 @@ static int kgdb_trgt_frame_offset[] = { }; static struct kgdb_frame_cache * -kgdb_trgt_frame_cache(struct frame_info *next_frame __unused, void **this_cache __unused) +kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache) { char buf[MAX_REGISTER_SIZE]; struct kgdb_frame_cache *cache; @@ -190,10 +199,12 @@ static const struct frame_unwind kgdb_trgt_trapframe_unwind = { &kgdb_trgt_trapframe_this_id, &kgdb_trgt_trapframe_prev_register }; +#endif const struct frame_unwind * -kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame __unused) +kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) { +#ifndef CROSS_DEBUGGER char *pname; CORE_ADDR pc; @@ -207,6 +218,6 @@ kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame __unused) (strcmp(pname, "MipsUserIntr") == 0) || (strcmp(pname, "MipsUserGenException") == 0)) return (&kgdb_trgt_trapframe_unwind); - /* printf("%s: %llx =%s\n", __func__, pc, pname); */ +#endif return (NULL); } diff --git a/gnu/usr.bin/gdb/libgdb/Makefile b/gnu/usr.bin/gdb/libgdb/Makefile index 8c22a1a..bb18a8e 100644 --- a/gnu/usr.bin/gdb/libgdb/Makefile +++ b/gnu/usr.bin/gdb/libgdb/Makefile @@ -1,6 +1,14 @@ # $FreeBSD$ -TARGET_ARCH?= ${MACHINE_ARCH} +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... + +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif +TARGET_ARCH?= ${MACHINE_ARCH} LIB= gdb INTERNALLIB= |