2003-04-16 Andrew Cagney <cagney@redhat.com>
* NEWS: Mention that sparclet-*-* and sparclite-*-* have been made obsolete. * sparc-tdep.c: Obsolete SPARCLET and SPARCLITE code. * sparcl-stub.c: Obsolete file. * config/sparc/tm-sparclet.h: Obsolete file. * sparclet-stub.c: Obsolete file. * sparclet-rom.c: Obsolete file. * sparcl-tdep.c: Obsolete file. * config/sparc/tm-sparclite.h: Obsolete file. * config/sparc/sparclite.mt: Obsolete file. * config/sparc/sparclet.mt: Obsolete file. * configure.tgt: Make sparclet-*-*, sparclite-*-*, and sparc86x-*-* obsolete.
This commit is contained in:
parent
39f1ebed0b
commit
f81824a9ed
12 changed files with 3823 additions and 3764 deletions
|
@ -1,3 +1,19 @@
|
|||
2003-04-16 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* NEWS: Mention that sparclet-*-* and sparclite-*-* have been made
|
||||
obsolete.
|
||||
* sparc-tdep.c: Obsolete SPARCLET and SPARCLITE code.
|
||||
* sparcl-stub.c: Obsolete file.
|
||||
* config/sparc/tm-sparclet.h: Obsolete file.
|
||||
* sparclet-stub.c: Obsolete file.
|
||||
* sparclet-rom.c: Obsolete file.
|
||||
* sparcl-tdep.c: Obsolete file.
|
||||
* config/sparc/tm-sparclite.h: Obsolete file.
|
||||
* config/sparc/sparclite.mt: Obsolete file.
|
||||
* config/sparc/sparclet.mt: Obsolete file.
|
||||
* configure.tgt: Make sparclet-*-*, sparclite-*-*, and
|
||||
sparc86x-*-* obsolete.
|
||||
|
||||
2003-04-15 David Carlton <carlton@math.stanford.edu>
|
||||
|
||||
* Makefile.in (SFILES): Add cp-namespace.c.
|
||||
|
|
2
gdb/NEWS
2
gdb/NEWS
|
@ -48,6 +48,8 @@ PMAX (MIPS) running Mach 3.0 mips*-*-mach3*
|
|||
Sequent family i[3456]86-sequent-sysv4*
|
||||
i[3456]86-sequent-sysv*
|
||||
i[3456]86-sequent-bsd*
|
||||
Tsqware Sparclet sparclet-*-*
|
||||
Fujitsu SPARClite sparclite-fujitsu-none or sparclite
|
||||
|
||||
* REMOVED configurations and files
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Target: SPARC embedded Sparclet monitor
|
||||
TDEPFILES= sparc-tdep.o monitor.o sparclet-rom.o dsrec.o
|
||||
TM_FILE= tm-sparclet.h
|
||||
# OBSOLETE # Target: SPARC embedded Sparclet monitor
|
||||
# OBSOLETE TDEPFILES= sparc-tdep.o monitor.o sparclet-rom.o dsrec.o
|
||||
# OBSOLETE TM_FILE= tm-sparclet.h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Target: Fujitsu SPARClite processor
|
||||
TDEPFILES= sparc-tdep.o sparcl-tdep.o
|
||||
TM_FILE= tm-sparclite.h
|
||||
SIM_OBS = remote-sim.o
|
||||
SIM = ../sim/erc32/libsim.a
|
||||
# OBSOLETE # Target: Fujitsu SPARClite processor
|
||||
# OBSOLETE TDEPFILES= sparc-tdep.o sparcl-tdep.o
|
||||
# OBSOLETE TM_FILE= tm-sparclite.h
|
||||
# OBSOLETE SIM_OBS = remote-sim.o
|
||||
# OBSOLETE SIM = ../sim/erc32/libsim.a
|
||||
|
|
|
@ -1,158 +1,158 @@
|
|||
/* Target machine definitions for GDB for an embedded SPARC.
|
||||
Copyright 1996, 1997, 2000 Free Software Foundation, 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 2 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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "regcache.h"
|
||||
|
||||
#define TARGET_SPARCLET 1 /* Still needed for non-multi-arch case */
|
||||
|
||||
#include "sparc/tm-sparc.h"
|
||||
|
||||
/* Note: we are not defining GDB_MULTI_ARCH for the sparclet target
|
||||
at this time, because we have not figured out how to detect the
|
||||
sparclet target from the bfd structure. */
|
||||
|
||||
/* Sparclet regs, for debugging purposes. */
|
||||
|
||||
enum {
|
||||
CCSR_REGNUM = 72,
|
||||
CCPR_REGNUM = 73,
|
||||
CCCRCR_REGNUM = 74,
|
||||
CCOR_REGNUM = 75,
|
||||
CCOBR_REGNUM = 76,
|
||||
CCIBR_REGNUM = 77,
|
||||
CCIR_REGNUM = 78
|
||||
};
|
||||
|
||||
/* Select the sparclet disassembler. Slightly different instruction set from
|
||||
the V8 sparc. */
|
||||
|
||||
#undef TM_PRINT_INSN_MACH
|
||||
#define TM_PRINT_INSN_MACH bfd_mach_sparc_sparclet
|
||||
|
||||
/* overrides of tm-sparc.h */
|
||||
|
||||
#undef TARGET_BYTE_ORDER
|
||||
|
||||
/* Sequence of bytes for breakpoint instruction (ta 1). */
|
||||
#undef BREAKPOINT
|
||||
#define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
|
||||
#define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91}
|
||||
|
||||
#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
|
||||
/*
|
||||
* The following defines must go away for MULTI_ARCH.
|
||||
*/
|
||||
|
||||
#undef NUM_REGS /* formerly "72" */
|
||||
/* WIN FP CPU CCP ASR AWR APSR */
|
||||
#define NUM_REGS (32 + 32 + 8 + 8 + 8/*+ 32 + 1*/)
|
||||
|
||||
#undef REGISTER_BYTES /* formerly "(32*4 + 32*4 + 8*4)" */
|
||||
#define REGISTER_BYTES (32*4 + 32*4 + 8*4 + 8*4 + 8*4/* + 32*4 + 1*4*/)
|
||||
|
||||
/* Initializer for an array of names of registers.
|
||||
There should be NUM_REGS strings in this initializer. */
|
||||
/* Sparclet has no fp! */
|
||||
/* Compiler maps types for floats by number, so can't
|
||||
change the numbers here. */
|
||||
|
||||
#undef REGISTER_NAMES
|
||||
#define REGISTER_NAMES \
|
||||
{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
|
||||
"o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", \
|
||||
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
|
||||
"i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", \
|
||||
\
|
||||
"", "", "", "", "", "", "", "", /* no FPU regs */ \
|
||||
"", "", "", "", "", "", "", "", \
|
||||
"", "", "", "", "", "", "", "", \
|
||||
"", "", "", "", "", "", "", "", \
|
||||
/* no CPSR, FPSR */ \
|
||||
"y", "psr", "wim", "tbr", "pc", "npc", "", "", \
|
||||
\
|
||||
"ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "", \
|
||||
\
|
||||
/* ASR15 ASR19 (don't display them) */ \
|
||||
"asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22", \
|
||||
/* \
|
||||
"awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7", \
|
||||
"awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15", \
|
||||
"awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23", \
|
||||
"awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31", \
|
||||
"apsr", \
|
||||
*/ \
|
||||
}
|
||||
|
||||
/* Remove FP dependant code which was defined in tm-sparc.h */
|
||||
#undef FP0_REGNUM /* Floating point register 0 */
|
||||
#undef FPS_REGNUM /* Floating point status register */
|
||||
#undef CPS_REGNUM /* Coprocessor status register */
|
||||
|
||||
/* sparclet register numbers */
|
||||
#define CCSR_REGNUM 72
|
||||
|
||||
#undef DEPRECATED_EXTRACT_RETURN_VALUE
|
||||
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
{ \
|
||||
memcpy ((VALBUF), \
|
||||
(char *)(REGBUF) + REGISTER_RAW_SIZE (O0_REGNUM) * 8 + \
|
||||
(TYPE_LENGTH(TYPE) >= REGISTER_RAW_SIZE (O0_REGNUM) \
|
||||
? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \
|
||||
TYPE_LENGTH(TYPE)); \
|
||||
}
|
||||
#undef DEPRECATED_STORE_RETURN_VALUE
|
||||
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
{ \
|
||||
/* Other values are returned in register %o0. */ \
|
||||
deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
}
|
||||
|
||||
#endif /* GDB_MULTI_ARCH */
|
||||
|
||||
extern void sparclet_do_registers_info (int regnum, int all);
|
||||
#undef DEPRECATED_DO_REGISTERS_INFO
|
||||
#define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) sparclet_do_registers_info (REGNUM, ALL)
|
||||
|
||||
|
||||
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
|
||||
comment in <machine/setjmp.h>! */
|
||||
|
||||
#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
|
||||
|
||||
#define JB_ONSSTACK 0
|
||||
#define JB_SIGMASK 1
|
||||
#define JB_SP 2
|
||||
#define JB_PC 3
|
||||
#define JB_NPC 4
|
||||
#define JB_PSR 5
|
||||
#define JB_G1 6
|
||||
#define JB_O0 7
|
||||
#define JB_WBCNT 8
|
||||
|
||||
/* Figure out where the longjmp will land. We expect that we have just entered
|
||||
longjmp and haven't yet setup the stack frame, so the args are still in the
|
||||
output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
|
||||
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
|
||||
This routine returns true on success */
|
||||
|
||||
extern int get_longjmp_target (CORE_ADDR *);
|
||||
|
||||
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
|
||||
// OBSOLETE /* Target machine definitions for GDB for an embedded SPARC.
|
||||
// OBSOLETE Copyright 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of GDB.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
|
||||
// OBSOLETE (at your option) any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License
|
||||
// OBSOLETE along with this program; if not, write to the Free Software
|
||||
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// OBSOLETE Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "regcache.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define TARGET_SPARCLET 1 /* Still needed for non-multi-arch case */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sparc/tm-sparc.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Note: we are not defining GDB_MULTI_ARCH for the sparclet target
|
||||
// OBSOLETE at this time, because we have not figured out how to detect the
|
||||
// OBSOLETE sparclet target from the bfd structure. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Sparclet regs, for debugging purposes. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE enum {
|
||||
// OBSOLETE CCSR_REGNUM = 72,
|
||||
// OBSOLETE CCPR_REGNUM = 73,
|
||||
// OBSOLETE CCCRCR_REGNUM = 74,
|
||||
// OBSOLETE CCOR_REGNUM = 75,
|
||||
// OBSOLETE CCOBR_REGNUM = 76,
|
||||
// OBSOLETE CCIBR_REGNUM = 77,
|
||||
// OBSOLETE CCIR_REGNUM = 78
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Select the sparclet disassembler. Slightly different instruction set from
|
||||
// OBSOLETE the V8 sparc. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef TM_PRINT_INSN_MACH
|
||||
// OBSOLETE #define TM_PRINT_INSN_MACH bfd_mach_sparc_sparclet
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* overrides of tm-sparc.h */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef TARGET_BYTE_ORDER
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Sequence of bytes for breakpoint instruction (ta 1). */
|
||||
// OBSOLETE #undef BREAKPOINT
|
||||
// OBSOLETE #define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
|
||||
// OBSOLETE #define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91}
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
|
||||
// OBSOLETE /*
|
||||
// OBSOLETE * The following defines must go away for MULTI_ARCH.
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef NUM_REGS /* formerly "72" */
|
||||
// OBSOLETE /* WIN FP CPU CCP ASR AWR APSR */
|
||||
// OBSOLETE #define NUM_REGS (32 + 32 + 8 + 8 + 8/*+ 32 + 1*/)
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef REGISTER_BYTES /* formerly "(32*4 + 32*4 + 8*4)" */
|
||||
// OBSOLETE #define REGISTER_BYTES (32*4 + 32*4 + 8*4 + 8*4 + 8*4/* + 32*4 + 1*4*/)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Initializer for an array of names of registers.
|
||||
// OBSOLETE There should be NUM_REGS strings in this initializer. */
|
||||
// OBSOLETE /* Sparclet has no fp! */
|
||||
// OBSOLETE /* Compiler maps types for floats by number, so can't
|
||||
// OBSOLETE change the numbers here. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef REGISTER_NAMES
|
||||
// OBSOLETE #define REGISTER_NAMES \
|
||||
// OBSOLETE { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
|
||||
// OBSOLETE "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", \
|
||||
// OBSOLETE "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
|
||||
// OBSOLETE "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", \
|
||||
// OBSOLETE \
|
||||
// OBSOLETE "", "", "", "", "", "", "", "", /* no FPU regs */ \
|
||||
// OBSOLETE "", "", "", "", "", "", "", "", \
|
||||
// OBSOLETE "", "", "", "", "", "", "", "", \
|
||||
// OBSOLETE "", "", "", "", "", "", "", "", \
|
||||
// OBSOLETE /* no CPSR, FPSR */ \
|
||||
// OBSOLETE "y", "psr", "wim", "tbr", "pc", "npc", "", "", \
|
||||
// OBSOLETE \
|
||||
// OBSOLETE "ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "", \
|
||||
// OBSOLETE \
|
||||
// OBSOLETE /* ASR15 ASR19 (don't display them) */ \
|
||||
// OBSOLETE "asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22", \
|
||||
// OBSOLETE /* \
|
||||
// OBSOLETE "awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7", \
|
||||
// OBSOLETE "awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15", \
|
||||
// OBSOLETE "awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23", \
|
||||
// OBSOLETE "awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31", \
|
||||
// OBSOLETE "apsr", \
|
||||
// OBSOLETE */ \
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Remove FP dependant code which was defined in tm-sparc.h */
|
||||
// OBSOLETE #undef FP0_REGNUM /* Floating point register 0 */
|
||||
// OBSOLETE #undef FPS_REGNUM /* Floating point status register */
|
||||
// OBSOLETE #undef CPS_REGNUM /* Coprocessor status register */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* sparclet register numbers */
|
||||
// OBSOLETE #define CCSR_REGNUM 72
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef DEPRECATED_EXTRACT_RETURN_VALUE
|
||||
// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
// OBSOLETE { \
|
||||
// OBSOLETE memcpy ((VALBUF), \
|
||||
// OBSOLETE (char *)(REGBUF) + REGISTER_RAW_SIZE (O0_REGNUM) * 8 + \
|
||||
// OBSOLETE (TYPE_LENGTH(TYPE) >= REGISTER_RAW_SIZE (O0_REGNUM) \
|
||||
// OBSOLETE ? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \
|
||||
// OBSOLETE TYPE_LENGTH(TYPE)); \
|
||||
// OBSOLETE }
|
||||
// OBSOLETE #undef DEPRECATED_STORE_RETURN_VALUE
|
||||
// OBSOLETE #define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
// OBSOLETE { \
|
||||
// OBSOLETE /* Other values are returned in register %o0. */ \
|
||||
// OBSOLETE deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
|
||||
// OBSOLETE TYPE_LENGTH (TYPE)); \
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* GDB_MULTI_ARCH */
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern void sparclet_do_registers_info (int regnum, int all);
|
||||
// OBSOLETE #undef DEPRECATED_DO_REGISTERS_INFO
|
||||
// OBSOLETE #define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) sparclet_do_registers_info (REGNUM, ALL)
|
||||
// OBSOLETE
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
|
||||
// OBSOLETE comment in <machine/setjmp.h>! */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define JB_ONSSTACK 0
|
||||
// OBSOLETE #define JB_SIGMASK 1
|
||||
// OBSOLETE #define JB_SP 2
|
||||
// OBSOLETE #define JB_PC 3
|
||||
// OBSOLETE #define JB_NPC 4
|
||||
// OBSOLETE #define JB_PSR 5
|
||||
// OBSOLETE #define JB_G1 6
|
||||
// OBSOLETE #define JB_O0 7
|
||||
// OBSOLETE #define JB_WBCNT 8
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Figure out where the longjmp will land. We expect that we have just entered
|
||||
// OBSOLETE longjmp and haven't yet setup the stack frame, so the args are still in the
|
||||
// OBSOLETE output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
|
||||
// OBSOLETE extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
|
||||
// OBSOLETE This routine returns true on success */
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern int get_longjmp_target (CORE_ADDR *);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
|
||||
|
|
|
@ -1,123 +1,123 @@
|
|||
/* Macro definitions for GDB for a Fujitsu SPARClite.
|
||||
Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, 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 2 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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "regcache.h"
|
||||
|
||||
#define TARGET_SPARCLITE 1 /* Still needed for non-multi-arch case */
|
||||
|
||||
#include "sparc/tm-sparc.h"
|
||||
|
||||
/* Note: we are not defining GDB_MULTI_ARCH for the sparclet target
|
||||
at this time, because we have not figured out how to detect the
|
||||
sparclet target from the bfd structure. */
|
||||
|
||||
/* Sparclite regs, for debugging purposes */
|
||||
|
||||
enum {
|
||||
DIA1_REGNUM = 72, /* debug instr address register 1 */
|
||||
DIA2_REGNUM = 73, /* debug instr address register 2 */
|
||||
DDA1_REGNUM = 74, /* debug data address register 1 */
|
||||
DDA2_REGNUM = 75, /* debug data address register 2 */
|
||||
DDV1_REGNUM = 76, /* debug data value register 1 */
|
||||
DDV2_REGNUM = 77, /* debug data value register 2 */
|
||||
DCR_REGNUM = 78, /* debug control register */
|
||||
DSR_REGNUM = 79 /* debug status regsiter */
|
||||
};
|
||||
|
||||
/* overrides of tm-sparc.h */
|
||||
|
||||
#undef TARGET_BYTE_ORDER
|
||||
|
||||
/* Select the sparclite disassembler. Slightly different instruction set from
|
||||
the V8 sparc. */
|
||||
|
||||
#undef TM_PRINT_INSN_MACH
|
||||
#define TM_PRINT_INSN_MACH bfd_mach_sparc_sparclite
|
||||
|
||||
/* Amount PC must be decremented by after a hardware instruction breakpoint.
|
||||
This is often the number of bytes in BREAKPOINT
|
||||
but not always. */
|
||||
|
||||
#define DECR_PC_AFTER_HW_BREAK 4
|
||||
|
||||
#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
|
||||
/*
|
||||
* The following defines must go away for MULTI_ARCH.
|
||||
*/
|
||||
|
||||
#undef NUM_REGS
|
||||
#define NUM_REGS 80
|
||||
|
||||
#undef REGISTER_BYTES
|
||||
#define REGISTER_BYTES (32*4+32*4+8*4+8*4)
|
||||
|
||||
#undef REGISTER_NAMES
|
||||
#define REGISTER_NAMES \
|
||||
{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
|
||||
"o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
|
||||
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
|
||||
"i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
|
||||
\
|
||||
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
|
||||
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
|
||||
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
|
||||
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
|
||||
\
|
||||
"y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr", \
|
||||
"dia1", "dia2", "dda1", "dda2", "ddv1", "ddv2", "dcr", "dsr" }
|
||||
|
||||
#define DIA1_REGNUM 72 /* debug instr address register 1 */
|
||||
#define DIA2_REGNUM 73 /* debug instr address register 2 */
|
||||
#define DDA1_REGNUM 74 /* debug data address register 1 */
|
||||
#define DDA2_REGNUM 75 /* debug data address register 2 */
|
||||
#define DDV1_REGNUM 76 /* debug data value register 1 */
|
||||
#define DDV2_REGNUM 77 /* debug data value register 2 */
|
||||
#define DCR_REGNUM 78 /* debug control register */
|
||||
#define DSR_REGNUM 79 /* debug status regsiter */
|
||||
|
||||
#endif /* GDB_MULTI_ARCH */
|
||||
|
||||
#define TARGET_HW_BREAK_LIMIT 2
|
||||
#define TARGET_HW_WATCH_LIMIT 2
|
||||
|
||||
/* Enable watchpoint macro's */
|
||||
|
||||
#define TARGET_HAS_HARDWARE_WATCHPOINTS
|
||||
|
||||
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
|
||||
sparclite_check_watch_resources (type, cnt, ot)
|
||||
|
||||
/* When a hardware watchpoint fires off the PC will be left at the
|
||||
instruction which caused the watchpoint. It will be necessary for
|
||||
GDB to step over the watchpoint. ***
|
||||
|
||||
#define STOPPED_BY_WATCHPOINT(W) \
|
||||
((W).kind == TARGET_WAITKIND_STOPPED \
|
||||
&& (W).value.sig == TARGET_SIGNAL_TRAP \
|
||||
&& ((int) read_register (IPSW_REGNUM) & 0x00100000))
|
||||
*/
|
||||
|
||||
/* Use these macros for watchpoint insertion/deletion. */
|
||||
#define target_insert_watchpoint(addr, len, type) sparclite_insert_watchpoint (addr, len, type)
|
||||
#define target_remove_watchpoint(addr, len, type) sparclite_remove_watchpoint (addr, len, type)
|
||||
#define target_insert_hw_breakpoint(addr, len) sparclite_insert_hw_breakpoint (addr, len)
|
||||
#define target_remove_hw_breakpoint(addr, len) sparclite_remove_hw_breakpoint (addr, len)
|
||||
#define target_stopped_data_address() sparclite_stopped_data_address()
|
||||
// OBSOLETE /* Macro definitions for GDB for a Fujitsu SPARClite.
|
||||
// OBSOLETE Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
// OBSOLETE Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of GDB.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
|
||||
// OBSOLETE (at your option) any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License
|
||||
// OBSOLETE along with this program; if not, write to the Free Software
|
||||
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// OBSOLETE Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "regcache.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define TARGET_SPARCLITE 1 /* Still needed for non-multi-arch case */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sparc/tm-sparc.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Note: we are not defining GDB_MULTI_ARCH for the sparclet target
|
||||
// OBSOLETE at this time, because we have not figured out how to detect the
|
||||
// OBSOLETE sparclet target from the bfd structure. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Sparclite regs, for debugging purposes */
|
||||
// OBSOLETE
|
||||
// OBSOLETE enum {
|
||||
// OBSOLETE DIA1_REGNUM = 72, /* debug instr address register 1 */
|
||||
// OBSOLETE DIA2_REGNUM = 73, /* debug instr address register 2 */
|
||||
// OBSOLETE DDA1_REGNUM = 74, /* debug data address register 1 */
|
||||
// OBSOLETE DDA2_REGNUM = 75, /* debug data address register 2 */
|
||||
// OBSOLETE DDV1_REGNUM = 76, /* debug data value register 1 */
|
||||
// OBSOLETE DDV2_REGNUM = 77, /* debug data value register 2 */
|
||||
// OBSOLETE DCR_REGNUM = 78, /* debug control register */
|
||||
// OBSOLETE DSR_REGNUM = 79 /* debug status regsiter */
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* overrides of tm-sparc.h */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef TARGET_BYTE_ORDER
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Select the sparclite disassembler. Slightly different instruction set from
|
||||
// OBSOLETE the V8 sparc. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef TM_PRINT_INSN_MACH
|
||||
// OBSOLETE #define TM_PRINT_INSN_MACH bfd_mach_sparc_sparclite
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Amount PC must be decremented by after a hardware instruction breakpoint.
|
||||
// OBSOLETE This is often the number of bytes in BREAKPOINT
|
||||
// OBSOLETE but not always. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define DECR_PC_AFTER_HW_BREAK 4
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
|
||||
// OBSOLETE /*
|
||||
// OBSOLETE * The following defines must go away for MULTI_ARCH.
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef NUM_REGS
|
||||
// OBSOLETE #define NUM_REGS 80
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef REGISTER_BYTES
|
||||
// OBSOLETE #define REGISTER_BYTES (32*4+32*4+8*4+8*4)
|
||||
// OBSOLETE
|
||||
// OBSOLETE #undef REGISTER_NAMES
|
||||
// OBSOLETE #define REGISTER_NAMES \
|
||||
// OBSOLETE { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
|
||||
// OBSOLETE "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
|
||||
// OBSOLETE "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
|
||||
// OBSOLETE "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
|
||||
// OBSOLETE \
|
||||
// OBSOLETE "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
|
||||
// OBSOLETE "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
|
||||
// OBSOLETE "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
|
||||
// OBSOLETE "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
|
||||
// OBSOLETE \
|
||||
// OBSOLETE "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr", \
|
||||
// OBSOLETE "dia1", "dia2", "dda1", "dda2", "ddv1", "ddv2", "dcr", "dsr" }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define DIA1_REGNUM 72 /* debug instr address register 1 */
|
||||
// OBSOLETE #define DIA2_REGNUM 73 /* debug instr address register 2 */
|
||||
// OBSOLETE #define DDA1_REGNUM 74 /* debug data address register 1 */
|
||||
// OBSOLETE #define DDA2_REGNUM 75 /* debug data address register 2 */
|
||||
// OBSOLETE #define DDV1_REGNUM 76 /* debug data value register 1 */
|
||||
// OBSOLETE #define DDV2_REGNUM 77 /* debug data value register 2 */
|
||||
// OBSOLETE #define DCR_REGNUM 78 /* debug control register */
|
||||
// OBSOLETE #define DSR_REGNUM 79 /* debug status regsiter */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* GDB_MULTI_ARCH */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define TARGET_HW_BREAK_LIMIT 2
|
||||
// OBSOLETE #define TARGET_HW_WATCH_LIMIT 2
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Enable watchpoint macro's */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define TARGET_HAS_HARDWARE_WATCHPOINTS
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
|
||||
// OBSOLETE sparclite_check_watch_resources (type, cnt, ot)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* When a hardware watchpoint fires off the PC will be left at the
|
||||
// OBSOLETE instruction which caused the watchpoint. It will be necessary for
|
||||
// OBSOLETE GDB to step over the watchpoint. ***
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define STOPPED_BY_WATCHPOINT(W) \
|
||||
// OBSOLETE ((W).kind == TARGET_WAITKIND_STOPPED \
|
||||
// OBSOLETE && (W).value.sig == TARGET_SIGNAL_TRAP \
|
||||
// OBSOLETE && ((int) read_register (IPSW_REGNUM) & 0x00100000))
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Use these macros for watchpoint insertion/deletion. */
|
||||
// OBSOLETE #define target_insert_watchpoint(addr, len, type) sparclite_insert_watchpoint (addr, len, type)
|
||||
// OBSOLETE #define target_remove_watchpoint(addr, len, type) sparclite_remove_watchpoint (addr, len, type)
|
||||
// OBSOLETE #define target_insert_hw_breakpoint(addr, len) sparclite_insert_hw_breakpoint (addr, len)
|
||||
// OBSOLETE #define target_remove_hw_breakpoint(addr, len) sparclite_remove_hw_breakpoint (addr, len)
|
||||
// OBSOLETE #define target_stopped_data_address() sparclite_stopped_data_address()
|
||||
|
|
|
@ -229,9 +229,9 @@ sparc-*-sunos4*) gdb_target=sun4os4 ;;
|
|||
sparc-*-sunos5*) gdb_target=sun4sol2 ;;
|
||||
sparc-*-vxworks*) gdb_target=vxsparc ;;
|
||||
sparc-*-*) gdb_target=sun4os4 ;;
|
||||
sparclet-*-*) gdb_target=sparclet;;
|
||||
sparclite-*-*) gdb_target=sparclite ;;
|
||||
sparc86x-*-*) gdb_target=sparclite ;;
|
||||
# OBSOLETE sparclet-*-*) gdb_target=sparclet;;
|
||||
# OBSOLETE sparclite-*-*) gdb_target=sparclite ;;
|
||||
# OBSOLETE sparc86x-*-*) gdb_target=sparclite ;;
|
||||
# It's not clear what the right solution for "v8plus" systems is yet.
|
||||
# For now, stick with sparc-sun-solaris2 since that's what config.guess
|
||||
# should return. Work is still needed to get gdb to print the 64 bit
|
||||
|
|
389
gdb/sparc-tdep.c
389
gdb/sparc-tdep.c
|
@ -66,11 +66,14 @@
|
|||
|
||||
|
||||
/* Does the target have Floating Point registers? */
|
||||
#if defined(TARGET_SPARCLET) || defined(TARGET_SPARCLITE)
|
||||
#define SPARC_HAS_FPU 0
|
||||
#else
|
||||
#define SPARC_HAS_FPU 1
|
||||
#if 0
|
||||
// OBSOLETE #if defined(TARGET_SPARCLET) || defined(TARGET_SPARCLITE)
|
||||
// OBSOLETE #define SPARC_HAS_FPU 0
|
||||
// OBSOLETE #else
|
||||
// OBSOLETE #define SPARC_HAS_FPU 1
|
||||
// OBSOLETE #endif
|
||||
#endif
|
||||
#define SPARC_HAS_FPU 1
|
||||
|
||||
/* Number of bytes devoted to Floating Point registers: */
|
||||
#if (GDB_TARGET_IS_SPARC64)
|
||||
|
@ -104,7 +107,9 @@
|
|||
|
||||
struct gdbarch_tdep
|
||||
{
|
||||
int has_fpu;
|
||||
#if 0
|
||||
// OBSOLETE int has_fpu;
|
||||
#endif
|
||||
int fp_register_bytes;
|
||||
int y_regnum;
|
||||
int fp_max_regnum;
|
||||
|
@ -134,11 +139,13 @@ extern int stop_after_trap;
|
|||
int deferred_stores = 0; /* Accumulated stores we want to do eventually. */
|
||||
|
||||
|
||||
/* Some machines, such as Fujitsu SPARClite 86x, have a bi-endian mode
|
||||
where instructions are big-endian and data are little-endian.
|
||||
This flag is set when we detect that the target is of this type. */
|
||||
|
||||
int bi_endian = 0;
|
||||
#if 0
|
||||
// OBSOLETE /* Some machines, such as Fujitsu SPARClite 86x, have a bi-endian mode
|
||||
// OBSOLETE where instructions are big-endian and data are little-endian.
|
||||
// OBSOLETE This flag is set when we detect that the target is of this type. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE int bi_endian = 0;
|
||||
#endif
|
||||
|
||||
|
||||
/* Fetch a single instruction. Even on bi-endian machines
|
||||
|
@ -2174,21 +2181,23 @@ sparc_do_registers_info (int regnum, int all)
|
|||
regnum, all);
|
||||
}
|
||||
|
||||
static void
|
||||
sparclet_print_registers_info (struct gdbarch *gdbarch,
|
||||
struct ui_file *file,
|
||||
struct frame_info *frame,
|
||||
int regnum, int print_all)
|
||||
{
|
||||
sparc_print_registers (gdbarch, file, frame, regnum, print_all, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
sparclet_do_registers_info (int regnum, int all)
|
||||
{
|
||||
sparclet_print_registers_info (current_gdbarch, gdb_stdout,
|
||||
deprecated_selected_frame, regnum, all);
|
||||
}
|
||||
#if 0
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE sparclet_print_registers_info (struct gdbarch *gdbarch,
|
||||
// OBSOLETE struct ui_file *file,
|
||||
// OBSOLETE struct frame_info *frame,
|
||||
// OBSOLETE int regnum, int print_all)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE sparc_print_registers (gdbarch, file, frame, regnum, print_all, NULL);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE sparclet_do_registers_info (int regnum, int all)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE sparclet_print_registers_info (current_gdbarch, gdb_stdout,
|
||||
// OBSOLETE deprecated_selected_frame, regnum, all);
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
|
@ -2324,13 +2333,15 @@ sparc_store_return_value (struct type *type, char *valbuf)
|
|||
TYPE_LENGTH (type));
|
||||
}
|
||||
|
||||
extern void
|
||||
sparclet_store_return_value (struct type *type, char *valbuf)
|
||||
{
|
||||
/* Other values are returned in register %o0. */
|
||||
deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), valbuf,
|
||||
TYPE_LENGTH (type));
|
||||
}
|
||||
#if 0
|
||||
// OBSOLETE extern void
|
||||
// OBSOLETE sparclet_store_return_value (struct type *type, char *valbuf)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Other values are returned in register %o0. */
|
||||
// OBSOLETE deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), valbuf,
|
||||
// OBSOLETE TYPE_LENGTH (type));
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CALL_DUMMY_CALL_OFFSET
|
||||
|
@ -2396,40 +2407,43 @@ sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
|
|||
}
|
||||
}
|
||||
|
||||
/* If this is a bi-endian target, GDB has written the call dummy
|
||||
in little-endian order. We must byte-swap it back to big-endian. */
|
||||
if (bi_endian)
|
||||
{
|
||||
for (i = 0; i < CALL_DUMMY_LENGTH; i += 4)
|
||||
{
|
||||
char tmp = dummy[i];
|
||||
dummy[i] = dummy[i + 3];
|
||||
dummy[i + 3] = tmp;
|
||||
tmp = dummy[i + 1];
|
||||
dummy[i + 1] = dummy[i + 2];
|
||||
dummy[i + 2] = tmp;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
// OBSOLETE /* If this is a bi-endian target, GDB has written the call dummy
|
||||
// OBSOLETE in little-endian order. We must byte-swap it back to big-endian. */
|
||||
// OBSOLETE if (bi_endian)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE for (i = 0; i < CALL_DUMMY_LENGTH; i += 4)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE char tmp = dummy[i];
|
||||
// OBSOLETE dummy[i] = dummy[i + 3];
|
||||
// OBSOLETE dummy[i + 3] = tmp;
|
||||
// OBSOLETE tmp = dummy[i + 1];
|
||||
// OBSOLETE dummy[i + 1] = dummy[i + 2];
|
||||
// OBSOLETE dummy[i + 2] = tmp;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Set target byte order based on machine type. */
|
||||
|
||||
static int
|
||||
sparc_target_architecture_hook (const bfd_arch_info_type *ap)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
if (ap->mach == bfd_mach_sparc_sparclite_le)
|
||||
{
|
||||
target_byte_order = BFD_ENDIAN_LITTLE;
|
||||
bi_endian = 1;
|
||||
}
|
||||
else
|
||||
bi_endian = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// OBSOLETE /* Set target byte order based on machine type. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static int
|
||||
// OBSOLETE sparc_target_architecture_hook (const bfd_arch_info_type *ap)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int i, j;
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (ap->mach == bfd_mach_sparc_sparclite_le)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE target_byte_order = BFD_ENDIAN_LITTLE;
|
||||
// OBSOLETE bi_endian = 1;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE bi_endian = 0;
|
||||
// OBSOLETE return 1;
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Module "constructor" function.
|
||||
|
@ -2447,7 +2461,7 @@ _initialize_sparc_tdep (void)
|
|||
|
||||
tm_print_insn = gdb_print_insn_sparc;
|
||||
tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
|
||||
target_architecture_hook = sparc_target_architecture_hook;
|
||||
/* OBSOLETE target_architecture_hook = sparc_target_architecture_hook; */
|
||||
}
|
||||
|
||||
/* Compensate for stack bias. Note that we currently don't handle
|
||||
|
@ -2677,18 +2691,19 @@ sparc64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
|
|||
sp64_extract_return_value (type, regbuf, valbuf, 0);
|
||||
}
|
||||
|
||||
extern void
|
||||
sparclet_extract_return_value (struct type *type,
|
||||
char *regbuf,
|
||||
char *valbuf)
|
||||
{
|
||||
regbuf += REGISTER_RAW_SIZE (O0_REGNUM) * 8;
|
||||
if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (O0_REGNUM))
|
||||
regbuf += REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH (type);
|
||||
|
||||
memcpy ((void *) valbuf, regbuf, TYPE_LENGTH (type));
|
||||
}
|
||||
|
||||
#if 0
|
||||
// OBSOLETE extern void
|
||||
// OBSOLETE sparclet_extract_return_value (struct type *type,
|
||||
// OBSOLETE char *regbuf,
|
||||
// OBSOLETE char *valbuf)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE regbuf += REGISTER_RAW_SIZE (O0_REGNUM) * 8;
|
||||
// OBSOLETE if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (O0_REGNUM))
|
||||
// OBSOLETE regbuf += REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH (type);
|
||||
// OBSOLETE
|
||||
// OBSOLETE memcpy ((void *) valbuf, regbuf, TYPE_LENGTH (type));
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
|
||||
extern CORE_ADDR
|
||||
sparc32_stack_align (CORE_ADDR addr)
|
||||
|
@ -2769,66 +2784,70 @@ sparc64_register_name (int regno)
|
|||
return register_names[regno];
|
||||
}
|
||||
|
||||
static const char *
|
||||
sparclite_register_name (int regno)
|
||||
{
|
||||
static char *register_names[] =
|
||||
{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
|
||||
"o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
|
||||
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
|
||||
"i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
|
||||
|
||||
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
|
||||
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
|
||||
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
|
||||
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
|
||||
|
||||
"y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr",
|
||||
"dia1", "dia2", "dda1", "dda2", "ddv1", "ddv2", "dcr", "dsr"
|
||||
};
|
||||
|
||||
if (regno < 0 ||
|
||||
regno >= (sizeof (register_names) / sizeof (register_names[0])))
|
||||
return NULL;
|
||||
else
|
||||
return register_names[regno];
|
||||
}
|
||||
|
||||
static const char *
|
||||
sparclet_register_name (int regno)
|
||||
{
|
||||
static char *register_names[] =
|
||||
{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
|
||||
"o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
|
||||
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
|
||||
"i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
|
||||
|
||||
"", "", "", "", "", "", "", "", /* no floating point registers */
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"y", "psr", "wim", "tbr", "pc", "npc", "", "", /* no FPSR or CPSR */
|
||||
"ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
|
||||
|
||||
/* ASR15 ASR19 (don't display them) */
|
||||
"asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22"
|
||||
/* None of the rest get displayed */
|
||||
#if 0
|
||||
"awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
|
||||
"awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
|
||||
"awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
|
||||
"awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
|
||||
"apsr"
|
||||
#endif /* 0 */
|
||||
};
|
||||
// OBSOLETE static const char *
|
||||
// OBSOLETE sparclite_register_name (int regno)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE static char *register_names[] =
|
||||
// OBSOLETE { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
|
||||
// OBSOLETE "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
|
||||
// OBSOLETE "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
|
||||
// OBSOLETE "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
|
||||
// OBSOLETE
|
||||
// OBSOLETE "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
|
||||
// OBSOLETE "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
|
||||
// OBSOLETE "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
|
||||
// OBSOLETE "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
|
||||
// OBSOLETE
|
||||
// OBSOLETE "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr",
|
||||
// OBSOLETE "dia1", "dia2", "dda1", "dda2", "ddv1", "ddv2", "dcr", "dsr"
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (regno < 0 ||
|
||||
// OBSOLETE regno >= (sizeof (register_names) / sizeof (register_names[0])))
|
||||
// OBSOLETE return NULL;
|
||||
// OBSOLETE else
|
||||
// OBSOLETE return register_names[regno];
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
|
||||
if (regno < 0 ||
|
||||
regno >= (sizeof (register_names) / sizeof (register_names[0])))
|
||||
return NULL;
|
||||
else
|
||||
return register_names[regno];
|
||||
}
|
||||
#if 0
|
||||
// OBSOLETE static const char *
|
||||
// OBSOLETE sparclet_register_name (int regno)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE static char *register_names[] =
|
||||
// OBSOLETE { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
|
||||
// OBSOLETE "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
|
||||
// OBSOLETE "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
|
||||
// OBSOLETE "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
|
||||
// OBSOLETE
|
||||
// OBSOLETE "", "", "", "", "", "", "", "", /* no floating point registers */
|
||||
// OBSOLETE "", "", "", "", "", "", "", "",
|
||||
// OBSOLETE "", "", "", "", "", "", "", "",
|
||||
// OBSOLETE "", "", "", "", "", "", "", "",
|
||||
// OBSOLETE
|
||||
// OBSOLETE "y", "psr", "wim", "tbr", "pc", "npc", "", "", /* no FPSR or CPSR */
|
||||
// OBSOLETE "ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* ASR15 ASR19 (don't display them) */
|
||||
// OBSOLETE "asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22"
|
||||
// OBSOLETE /* None of the rest get displayed */
|
||||
// OBSOLETE #if 0
|
||||
// OBSOLETE "awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
|
||||
// OBSOLETE "awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
|
||||
// OBSOLETE "awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
|
||||
// OBSOLETE "awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
|
||||
// OBSOLETE "apsr"
|
||||
// OBSOLETE #endif /* 0 */
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (regno < 0 ||
|
||||
// OBSOLETE regno >= (sizeof (register_names) / sizeof (register_names[0])))
|
||||
// OBSOLETE return NULL;
|
||||
// OBSOLETE else
|
||||
// OBSOLETE return register_names[regno];
|
||||
// OBSOLETE }
|
||||
#endif
|
||||
|
||||
CORE_ADDR
|
||||
sparc_push_return_address (CORE_ADDR pc_unused, CORE_ADDR sp)
|
||||
|
@ -3184,11 +3203,15 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
switch (info.bfd_arch_info->mach)
|
||||
{
|
||||
case bfd_mach_sparc:
|
||||
case bfd_mach_sparc_sparclet:
|
||||
case bfd_mach_sparc_sparclite:
|
||||
#if 0
|
||||
// OBSOLETE case bfd_mach_sparc_sparclet:
|
||||
// OBSOLETE case bfd_mach_sparc_sparclite:
|
||||
#endif
|
||||
case bfd_mach_sparc_v8plus:
|
||||
case bfd_mach_sparc_v8plusa:
|
||||
case bfd_mach_sparc_sparclite_le:
|
||||
#if 0
|
||||
// OBSOLETE case bfd_mach_sparc_sparclite_le:
|
||||
#endif
|
||||
/* 32-bit machine types: */
|
||||
|
||||
#ifdef SPARC32_CALL_DUMMY_ON_STACK
|
||||
|
@ -3348,30 +3371,36 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
|
||||
set_gdbarch_register_name (gdbarch, sparc32_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#if 0
|
||||
// OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#endif
|
||||
tdep->fp_register_bytes = 32 * 4;
|
||||
tdep->print_insn_mach = bfd_mach_sparc;
|
||||
break;
|
||||
case bfd_mach_sparc_sparclet:
|
||||
set_gdbarch_deprecated_extract_return_value (gdbarch, sparclet_extract_return_value);
|
||||
set_gdbarch_num_regs (gdbarch, 32 + 32 + 8 + 8 + 8);
|
||||
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4 + 8*4);
|
||||
set_gdbarch_register_name (gdbarch, sparclet_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparclet_store_return_value);
|
||||
tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
|
||||
tdep->fp_register_bytes = 0;
|
||||
tdep->print_insn_mach = bfd_mach_sparc_sparclet;
|
||||
break;
|
||||
case bfd_mach_sparc_sparclite:
|
||||
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
|
||||
set_gdbarch_num_regs (gdbarch, 80);
|
||||
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
|
||||
set_gdbarch_register_name (gdbarch, sparclite_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
|
||||
tdep->fp_register_bytes = 0;
|
||||
tdep->print_insn_mach = bfd_mach_sparc_sparclite;
|
||||
break;
|
||||
#if 0
|
||||
// OBSOLETE case bfd_mach_sparc_sparclet:
|
||||
// OBSOLETE set_gdbarch_deprecated_extract_return_value (gdbarch, sparclet_extract_return_value);
|
||||
// OBSOLETE set_gdbarch_num_regs (gdbarch, 32 + 32 + 8 + 8 + 8);
|
||||
// OBSOLETE set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4 + 8*4);
|
||||
// OBSOLETE set_gdbarch_register_name (gdbarch, sparclet_register_name);
|
||||
// OBSOLETE set_gdbarch_deprecated_store_return_value (gdbarch, sparclet_store_return_value);
|
||||
// OBSOLETE tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
|
||||
// OBSOLETE tdep->fp_register_bytes = 0;
|
||||
// OBSOLETE tdep->print_insn_mach = bfd_mach_sparc_sparclet;
|
||||
// OBSOLETE break;
|
||||
#endif
|
||||
#if 0
|
||||
// OBSOLETE case bfd_mach_sparc_sparclite:
|
||||
// OBSOLETE set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
|
||||
// OBSOLETE set_gdbarch_num_regs (gdbarch, 80);
|
||||
// OBSOLETE set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
|
||||
// OBSOLETE set_gdbarch_register_name (gdbarch, sparclite_register_name);
|
||||
// OBSOLETE set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
// OBSOLETE tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
|
||||
// OBSOLETE tdep->fp_register_bytes = 0;
|
||||
// OBSOLETE tdep->print_insn_mach = bfd_mach_sparc_sparclite;
|
||||
// OBSOLETE break;
|
||||
#endif
|
||||
case bfd_mach_sparc_v8plus:
|
||||
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
|
||||
set_gdbarch_num_regs (gdbarch, 72);
|
||||
|
@ -3380,7 +3409,9 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->print_insn_mach = bfd_mach_sparc;
|
||||
tdep->fp_register_bytes = 32 * 4;
|
||||
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#if 0
|
||||
// OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#endif
|
||||
break;
|
||||
case bfd_mach_sparc_v8plusa:
|
||||
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
|
||||
|
@ -3388,27 +3419,33 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
|
||||
set_gdbarch_register_name (gdbarch, sparc32_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#if 0
|
||||
// OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#endif
|
||||
tdep->fp_register_bytes = 32 * 4;
|
||||
tdep->print_insn_mach = bfd_mach_sparc;
|
||||
break;
|
||||
case bfd_mach_sparc_sparclite_le:
|
||||
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
|
||||
set_gdbarch_num_regs (gdbarch, 80);
|
||||
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
|
||||
set_gdbarch_register_name (gdbarch, sparclite_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
|
||||
tdep->fp_register_bytes = 0;
|
||||
tdep->print_insn_mach = bfd_mach_sparc_sparclite;
|
||||
break;
|
||||
#if 0
|
||||
// OBSOLETE case bfd_mach_sparc_sparclite_le:
|
||||
// OBSOLETE set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
|
||||
// OBSOLETE set_gdbarch_num_regs (gdbarch, 80);
|
||||
// OBSOLETE set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
|
||||
// OBSOLETE set_gdbarch_register_name (gdbarch, sparclite_register_name);
|
||||
// OBSOLETE set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
// OBSOLETE tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
|
||||
// OBSOLETE tdep->fp_register_bytes = 0;
|
||||
// OBSOLETE tdep->print_insn_mach = bfd_mach_sparc_sparclite;
|
||||
// OBSOLETE break;
|
||||
#endif
|
||||
case bfd_mach_sparc_v9:
|
||||
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
|
||||
set_gdbarch_num_regs (gdbarch, 125);
|
||||
set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
|
||||
set_gdbarch_register_name (gdbarch, sparc64_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#if 0
|
||||
// OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#endif
|
||||
tdep->fp_register_bytes = 64 * 4;
|
||||
tdep->print_insn_mach = bfd_mach_sparc_v9a;
|
||||
break;
|
||||
|
@ -3418,7 +3455,9 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
|
||||
set_gdbarch_register_name (gdbarch, sparc64_register_name);
|
||||
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
|
||||
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#if 0
|
||||
// OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
|
||||
#endif
|
||||
tdep->fp_register_bytes = 64 * 4;
|
||||
tdep->print_insn_mach = bfd_mach_sparc_v9a;
|
||||
break;
|
||||
|
@ -3438,8 +3477,10 @@ sparc_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
|
|||
if (tdep == NULL)
|
||||
return;
|
||||
|
||||
fprintf_unfiltered (file, "sparc_dump_tdep: has_fpu = %d\n",
|
||||
tdep->has_fpu);
|
||||
#if 0
|
||||
// OBSOLETE fprintf_unfiltered (file, "sparc_dump_tdep: has_fpu = %d\n",
|
||||
// OBSOLETE tdep->has_fpu);
|
||||
#endif
|
||||
fprintf_unfiltered (file, "sparc_dump_tdep: fp_register_bytes = %d\n",
|
||||
tdep->fp_register_bytes);
|
||||
fprintf_unfiltered (file, "sparc_dump_tdep: y_regnum = %d\n",
|
||||
|
|
1892
gdb/sparcl-stub.c
1892
gdb/sparcl-stub.c
File diff suppressed because it is too large
Load diff
1738
gdb/sparcl-tdep.c
1738
gdb/sparcl-tdep.c
File diff suppressed because it is too large
Load diff
|
@ -1,316 +1,316 @@
|
|||
/* Remote target glue for the SPARC Sparclet ROM monitor.
|
||||
|
||||
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free
|
||||
Software Foundation, 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 2 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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#include "defs.h"
|
||||
#include "gdbcore.h"
|
||||
#include "target.h"
|
||||
#include "monitor.h"
|
||||
#include "serial.h"
|
||||
#include "srec.h"
|
||||
#include "symtab.h"
|
||||
#include "symfile.h" /* for generic_load */
|
||||
#include "regcache.h"
|
||||
#include <time.h>
|
||||
|
||||
extern void report_transfer_performance (unsigned long, time_t, time_t);
|
||||
|
||||
static struct target_ops sparclet_ops;
|
||||
|
||||
static void sparclet_open (char *args, int from_tty);
|
||||
|
||||
/* This array of registers need to match the indexes used by GDB.
|
||||
This exists because the various ROM monitors use different strings
|
||||
than does GDB, and don't necessarily support all the registers
|
||||
either. So, typing "info reg sp" becomes a "r30". */
|
||||
|
||||
/*PSR 0x00000080 impl ver icc AW LE EE EC EF PIL S PS ET CWP WIM
|
||||
0x0 0x0 0x0 0 0 0 0 0 0x0 1 0 0 0x00 0x2
|
||||
0000010
|
||||
INS LOCALS OUTS GLOBALS
|
||||
0 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
1 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
2 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
3 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
4 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
5 0x00000000 0x00001000 0x00000000 0x00000000
|
||||
6 0x00000000 0x00000000 0x123f0000 0x00000000
|
||||
7 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
pc: 0x12010000 0x00000000 unimp
|
||||
npc: 0x12010004 0x00001000 unimp 0x1000
|
||||
tbr: 0x00000000
|
||||
y: 0x00000000
|
||||
*/
|
||||
/* these correspond to the offsets from tm-* files from config directories */
|
||||
|
||||
/* is wim part of psr?? */
|
||||
/* monitor wants lower case */
|
||||
static char *sparclet_regnames[] = {
|
||||
"g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
|
||||
"o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7",
|
||||
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
|
||||
"i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7",
|
||||
|
||||
"", "", "", "", "", "", "", "", /* no FPU regs */
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* no CPSR, FPSR */
|
||||
"y", "psr", "wim", "tbr", "pc", "npc", "", "",
|
||||
|
||||
"ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
|
||||
|
||||
/* ASR15 ASR19 (don't display them) */
|
||||
"asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22",
|
||||
/*
|
||||
"awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
|
||||
"awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
|
||||
"awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
|
||||
"awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
|
||||
"apsr",
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* Function: sparclet_supply_register
|
||||
Just returns with no action.
|
||||
This function is required, because parse_register_dump (monitor.c)
|
||||
expects to be able to call it. If we don't supply something, it will
|
||||
call a null pointer and core-dump. Since this function does not
|
||||
actually do anything, GDB will request the registers individually. */
|
||||
|
||||
static void
|
||||
sparclet_supply_register (char *regname, int regnamelen, char *val, int vallen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
sparclet_load (struct serial *desc, char *file, int hashmark)
|
||||
{
|
||||
bfd *abfd;
|
||||
asection *s;
|
||||
int i;
|
||||
CORE_ADDR load_offset;
|
||||
time_t start_time, end_time;
|
||||
unsigned long data_count = 0;
|
||||
|
||||
/* enable user to specify address for downloading as 2nd arg to load */
|
||||
|
||||
i = sscanf (file, "%*s 0x%lx", &load_offset);
|
||||
if (i >= 1)
|
||||
{
|
||||
char *p;
|
||||
|
||||
for (p = file; *p != '\000' && !isspace (*p); p++);
|
||||
|
||||
*p = '\000';
|
||||
}
|
||||
else
|
||||
load_offset = 0;
|
||||
|
||||
abfd = bfd_openr (file, 0);
|
||||
if (!abfd)
|
||||
{
|
||||
printf_filtered ("Unable to open file %s\n", file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bfd_check_format (abfd, bfd_object) == 0)
|
||||
{
|
||||
printf_filtered ("File is not an object file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
start_time = time (NULL);
|
||||
|
||||
for (s = abfd->sections; s; s = s->next)
|
||||
if (s->flags & SEC_LOAD)
|
||||
{
|
||||
bfd_size_type section_size;
|
||||
bfd_vma vma;
|
||||
|
||||
vma = bfd_get_section_vma (abfd, s) + load_offset;
|
||||
section_size = bfd_section_size (abfd, s);
|
||||
|
||||
data_count += section_size;
|
||||
|
||||
printf_filtered ("%s\t: 0x%4x .. 0x%4x ",
|
||||
bfd_get_section_name (abfd, s), vma,
|
||||
vma + section_size);
|
||||
gdb_flush (gdb_stdout);
|
||||
|
||||
monitor_printf ("load c r %x %x\r", vma, section_size);
|
||||
|
||||
monitor_expect ("load: loading ", NULL, 0);
|
||||
monitor_expect ("\r", NULL, 0);
|
||||
|
||||
for (i = 0; i < section_size; i += 2048)
|
||||
{
|
||||
int numbytes;
|
||||
char buf[2048];
|
||||
|
||||
numbytes = min (sizeof buf, section_size - i);
|
||||
|
||||
bfd_get_section_contents (abfd, s, buf, i, numbytes);
|
||||
|
||||
serial_write (desc, buf, numbytes);
|
||||
|
||||
if (hashmark)
|
||||
{
|
||||
putchar_unfiltered ('#');
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
} /* Per-packet (or S-record) loop */
|
||||
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
|
||||
putchar_unfiltered ('\n');
|
||||
} /* Loadable sections */
|
||||
|
||||
monitor_printf ("reg pc %x\r", bfd_get_start_address (abfd));
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
monitor_printf ("reg npc %x\r", bfd_get_start_address (abfd) + 4);
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
|
||||
monitor_printf ("run\r");
|
||||
|
||||
end_time = time (NULL);
|
||||
|
||||
if (hashmark)
|
||||
putchar_unfiltered ('\n');
|
||||
|
||||
report_transfer_performance (data_count, start_time, end_time);
|
||||
|
||||
pop_target ();
|
||||
push_remote_target (monitor_get_dev_name (), 1);
|
||||
|
||||
throw_exception (RETURN_QUIT);
|
||||
}
|
||||
|
||||
/* Define the monitor command strings. Since these are passed directly
|
||||
through to a printf style function, we may include formatting
|
||||
strings. We also need a CR or LF on the end. */
|
||||
|
||||
/* need to pause the monitor for timing reasons, so slow it down */
|
||||
|
||||
static char *sparclet_inits[] =
|
||||
{"\n\r\r\n", NULL};
|
||||
|
||||
static struct monitor_ops sparclet_cmds;
|
||||
|
||||
static void
|
||||
init_sparclet_cmds (void)
|
||||
{
|
||||
sparclet_cmds.flags = MO_CLR_BREAK_USES_ADDR |
|
||||
MO_HEX_PREFIX |
|
||||
MO_NO_ECHO_ON_OPEN |
|
||||
MO_NO_ECHO_ON_SETMEM |
|
||||
MO_RUN_FIRST_TIME |
|
||||
MO_GETMEM_READ_SINGLE; /* flags */
|
||||
sparclet_cmds.init = sparclet_inits; /* Init strings */
|
||||
sparclet_cmds.cont = "cont\r"; /* continue command */
|
||||
sparclet_cmds.step = "step\r"; /* single step */
|
||||
sparclet_cmds.stop = "\r"; /* break interrupts the program */
|
||||
sparclet_cmds.set_break = "+bp %x\r"; /* set a breakpoint */
|
||||
sparclet_cmds.clr_break = "-bp %x\r"; /* can't use "br" because only 2 hw bps are supported */
|
||||
sparclet_cmds.clr_all_break = "-bp %x\r"; /* clear a breakpoint */
|
||||
"-bp\r"; /* clear all breakpoints */
|
||||
sparclet_cmds.fill = "fill %x -n %x -v %x -b\r"; /* fill (start length val) */
|
||||
/* can't use "fi" because it takes words, not bytes */
|
||||
/* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */
|
||||
sparclet_cmds.setmem.cmdb = "ex %x -b\r%x\rq\r"; /* setmem.cmdb (addr, value) */
|
||||
sparclet_cmds.setmem.cmdw = "ex %x -s\r%x\rq\r"; /* setmem.cmdw (addr, value) */
|
||||
sparclet_cmds.setmem.cmdl = "ex %x -l\r%x\rq\r"; /* setmem.cmdl (addr, value) */
|
||||
sparclet_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */
|
||||
sparclet_cmds.setmem.resp_delim = NULL; /*": " *//* setmem.resp_delim */
|
||||
sparclet_cmds.setmem.term = NULL; /*"? " *//* setmem.term */
|
||||
sparclet_cmds.setmem.term_cmd = NULL; /*"q\r" *//* setmem.term_cmd */
|
||||
/* since the parsing of multiple bytes is difficult due to
|
||||
interspersed addresses, we'll only read 1 value at a time,
|
||||
even tho these can handle a count */
|
||||
/* we can use -n to set count to read, but may have to parse? */
|
||||
sparclet_cmds.getmem.cmdb = "ex %x -n 1 -b\r"; /* getmem.cmdb (addr, #bytes) */
|
||||
sparclet_cmds.getmem.cmdw = "ex %x -n 1 -s\r"; /* getmem.cmdw (addr, #swords) */
|
||||
sparclet_cmds.getmem.cmdl = "ex %x -n 1 -l\r"; /* getmem.cmdl (addr, #words) */
|
||||
sparclet_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, #dwords) */
|
||||
sparclet_cmds.getmem.resp_delim = ": "; /* getmem.resp_delim */
|
||||
sparclet_cmds.getmem.term = NULL; /* getmem.term */
|
||||
sparclet_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */
|
||||
sparclet_cmds.setreg.cmd = "reg %s 0x%x\r"; /* setreg.cmd (name, value) */
|
||||
sparclet_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */
|
||||
sparclet_cmds.setreg.term = NULL; /* setreg.term */
|
||||
sparclet_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */
|
||||
sparclet_cmds.getreg.cmd = "reg %s\r"; /* getreg.cmd (name) */
|
||||
sparclet_cmds.getreg.resp_delim = " "; /* getreg.resp_delim */
|
||||
sparclet_cmds.getreg.term = NULL; /* getreg.term */
|
||||
sparclet_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */
|
||||
sparclet_cmds.dump_registers = "reg\r"; /* dump_registers */
|
||||
sparclet_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */
|
||||
sparclet_cmds.supply_register = sparclet_supply_register; /* supply_register */
|
||||
sparclet_cmds.load_routine = sparclet_load; /* load_routine */
|
||||
sparclet_cmds.load = NULL; /* download command (srecs on console) */
|
||||
sparclet_cmds.loadresp = NULL; /* load response */
|
||||
sparclet_cmds.prompt = "monitor>"; /* monitor command prompt */
|
||||
/* yikes! gdb core dumps without this delimitor!! */
|
||||
sparclet_cmds.line_term = "\r"; /* end-of-command delimitor */
|
||||
sparclet_cmds.cmd_end = NULL; /* optional command terminator */
|
||||
sparclet_cmds.target = &sparclet_ops; /* target operations */
|
||||
sparclet_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
|
||||
sparclet_cmds.regnames = sparclet_regnames; /* registers names */
|
||||
sparclet_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
|
||||
};
|
||||
|
||||
static void
|
||||
sparclet_open (char *args, int from_tty)
|
||||
{
|
||||
monitor_open (args, &sparclet_cmds, from_tty);
|
||||
}
|
||||
|
||||
void
|
||||
_initialize_sparclet (void)
|
||||
{
|
||||
int i;
|
||||
init_sparclet_cmds ();
|
||||
|
||||
for (i = 0; i < NUM_REGS; i++)
|
||||
if (sparclet_regnames[i][0] == 'c' ||
|
||||
sparclet_regnames[i][0] == 'a')
|
||||
sparclet_regnames[i] = 0; /* mon can't report c* or a* regs */
|
||||
|
||||
sparclet_regnames[0] = 0; /* mon won't report %G0 */
|
||||
|
||||
init_monitor_ops (&sparclet_ops);
|
||||
sparclet_ops.to_shortname = "sparclet"; /* for the target command */
|
||||
sparclet_ops.to_longname = "SPARC Sparclet monitor";
|
||||
/* use SW breaks; target only supports 2 HW breakpoints */
|
||||
sparclet_ops.to_insert_breakpoint = memory_insert_breakpoint;
|
||||
sparclet_ops.to_remove_breakpoint = memory_remove_breakpoint;
|
||||
|
||||
sparclet_ops.to_doc =
|
||||
"Use a board running the Sparclet debug monitor.\n\
|
||||
Specify the serial device it is connected to (e.g. /dev/ttya).";
|
||||
|
||||
sparclet_ops.to_open = sparclet_open;
|
||||
add_target (&sparclet_ops);
|
||||
}
|
||||
// OBSOLETE /* Remote target glue for the SPARC Sparclet ROM monitor.
|
||||
// OBSOLETE
|
||||
// OBSOLETE Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free
|
||||
// OBSOLETE Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of GDB.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
|
||||
// OBSOLETE (at your option) any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License
|
||||
// OBSOLETE along with this program; if not, write to the Free Software
|
||||
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// OBSOLETE Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "defs.h"
|
||||
// OBSOLETE #include "gdbcore.h"
|
||||
// OBSOLETE #include "target.h"
|
||||
// OBSOLETE #include "monitor.h"
|
||||
// OBSOLETE #include "serial.h"
|
||||
// OBSOLETE #include "srec.h"
|
||||
// OBSOLETE #include "symtab.h"
|
||||
// OBSOLETE #include "symfile.h" /* for generic_load */
|
||||
// OBSOLETE #include "regcache.h"
|
||||
// OBSOLETE #include <time.h>
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern void report_transfer_performance (unsigned long, time_t, time_t);
|
||||
// OBSOLETE
|
||||
// OBSOLETE static struct target_ops sparclet_ops;
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void sparclet_open (char *args, int from_tty);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* This array of registers need to match the indexes used by GDB.
|
||||
// OBSOLETE This exists because the various ROM monitors use different strings
|
||||
// OBSOLETE than does GDB, and don't necessarily support all the registers
|
||||
// OBSOLETE either. So, typing "info reg sp" becomes a "r30". */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /*PSR 0x00000080 impl ver icc AW LE EE EC EF PIL S PS ET CWP WIM
|
||||
// OBSOLETE 0x0 0x0 0x0 0 0 0 0 0 0x0 1 0 0 0x00 0x2
|
||||
// OBSOLETE 0000010
|
||||
// OBSOLETE INS LOCALS OUTS GLOBALS
|
||||
// OBSOLETE 0 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
// OBSOLETE 1 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
// OBSOLETE 2 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
// OBSOLETE 3 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
// OBSOLETE 4 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
// OBSOLETE 5 0x00000000 0x00001000 0x00000000 0x00000000
|
||||
// OBSOLETE 6 0x00000000 0x00000000 0x123f0000 0x00000000
|
||||
// OBSOLETE 7 0x00000000 0x00000000 0x00000000 0x00000000
|
||||
// OBSOLETE pc: 0x12010000 0x00000000 unimp
|
||||
// OBSOLETE npc: 0x12010004 0x00001000 unimp 0x1000
|
||||
// OBSOLETE tbr: 0x00000000
|
||||
// OBSOLETE y: 0x00000000
|
||||
// OBSOLETE */
|
||||
// OBSOLETE /* these correspond to the offsets from tm-* files from config directories */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* is wim part of psr?? */
|
||||
// OBSOLETE /* monitor wants lower case */
|
||||
// OBSOLETE static char *sparclet_regnames[] = {
|
||||
// OBSOLETE "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
|
||||
// OBSOLETE "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7",
|
||||
// OBSOLETE "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
|
||||
// OBSOLETE "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7",
|
||||
// OBSOLETE
|
||||
// OBSOLETE "", "", "", "", "", "", "", "", /* no FPU regs */
|
||||
// OBSOLETE "", "", "", "", "", "", "", "",
|
||||
// OBSOLETE "", "", "", "", "", "", "", "",
|
||||
// OBSOLETE "", "", "", "", "", "", "", "",
|
||||
// OBSOLETE /* no CPSR, FPSR */
|
||||
// OBSOLETE "y", "psr", "wim", "tbr", "pc", "npc", "", "",
|
||||
// OBSOLETE
|
||||
// OBSOLETE "ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* ASR15 ASR19 (don't display them) */
|
||||
// OBSOLETE "asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22",
|
||||
// OBSOLETE /*
|
||||
// OBSOLETE "awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
|
||||
// OBSOLETE "awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
|
||||
// OBSOLETE "awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
|
||||
// OBSOLETE "awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
|
||||
// OBSOLETE "apsr",
|
||||
// OBSOLETE */
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Function: sparclet_supply_register
|
||||
// OBSOLETE Just returns with no action.
|
||||
// OBSOLETE This function is required, because parse_register_dump (monitor.c)
|
||||
// OBSOLETE expects to be able to call it. If we don't supply something, it will
|
||||
// OBSOLETE call a null pointer and core-dump. Since this function does not
|
||||
// OBSOLETE actually do anything, GDB will request the registers individually. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE sparclet_supply_register (char *regname, int regnamelen, char *val, int vallen)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE sparclet_load (struct serial *desc, char *file, int hashmark)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE bfd *abfd;
|
||||
// OBSOLETE asection *s;
|
||||
// OBSOLETE int i;
|
||||
// OBSOLETE CORE_ADDR load_offset;
|
||||
// OBSOLETE time_t start_time, end_time;
|
||||
// OBSOLETE unsigned long data_count = 0;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* enable user to specify address for downloading as 2nd arg to load */
|
||||
// OBSOLETE
|
||||
// OBSOLETE i = sscanf (file, "%*s 0x%lx", &load_offset);
|
||||
// OBSOLETE if (i >= 1)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE char *p;
|
||||
// OBSOLETE
|
||||
// OBSOLETE for (p = file; *p != '\000' && !isspace (*p); p++);
|
||||
// OBSOLETE
|
||||
// OBSOLETE *p = '\000';
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE load_offset = 0;
|
||||
// OBSOLETE
|
||||
// OBSOLETE abfd = bfd_openr (file, 0);
|
||||
// OBSOLETE if (!abfd)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE printf_filtered ("Unable to open file %s\n", file);
|
||||
// OBSOLETE return;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (bfd_check_format (abfd, bfd_object) == 0)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE printf_filtered ("File is not an object file\n");
|
||||
// OBSOLETE return;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE start_time = time (NULL);
|
||||
// OBSOLETE
|
||||
// OBSOLETE for (s = abfd->sections; s; s = s->next)
|
||||
// OBSOLETE if (s->flags & SEC_LOAD)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE bfd_size_type section_size;
|
||||
// OBSOLETE bfd_vma vma;
|
||||
// OBSOLETE
|
||||
// OBSOLETE vma = bfd_get_section_vma (abfd, s) + load_offset;
|
||||
// OBSOLETE section_size = bfd_section_size (abfd, s);
|
||||
// OBSOLETE
|
||||
// OBSOLETE data_count += section_size;
|
||||
// OBSOLETE
|
||||
// OBSOLETE printf_filtered ("%s\t: 0x%4x .. 0x%4x ",
|
||||
// OBSOLETE bfd_get_section_name (abfd, s), vma,
|
||||
// OBSOLETE vma + section_size);
|
||||
// OBSOLETE gdb_flush (gdb_stdout);
|
||||
// OBSOLETE
|
||||
// OBSOLETE monitor_printf ("load c r %x %x\r", vma, section_size);
|
||||
// OBSOLETE
|
||||
// OBSOLETE monitor_expect ("load: loading ", NULL, 0);
|
||||
// OBSOLETE monitor_expect ("\r", NULL, 0);
|
||||
// OBSOLETE
|
||||
// OBSOLETE for (i = 0; i < section_size; i += 2048)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int numbytes;
|
||||
// OBSOLETE char buf[2048];
|
||||
// OBSOLETE
|
||||
// OBSOLETE numbytes = min (sizeof buf, section_size - i);
|
||||
// OBSOLETE
|
||||
// OBSOLETE bfd_get_section_contents (abfd, s, buf, i, numbytes);
|
||||
// OBSOLETE
|
||||
// OBSOLETE serial_write (desc, buf, numbytes);
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (hashmark)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE putchar_unfiltered ('#');
|
||||
// OBSOLETE gdb_flush (gdb_stdout);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE } /* Per-packet (or S-record) loop */
|
||||
// OBSOLETE
|
||||
// OBSOLETE monitor_expect_prompt (NULL, 0);
|
||||
// OBSOLETE
|
||||
// OBSOLETE putchar_unfiltered ('\n');
|
||||
// OBSOLETE } /* Loadable sections */
|
||||
// OBSOLETE
|
||||
// OBSOLETE monitor_printf ("reg pc %x\r", bfd_get_start_address (abfd));
|
||||
// OBSOLETE monitor_expect_prompt (NULL, 0);
|
||||
// OBSOLETE monitor_printf ("reg npc %x\r", bfd_get_start_address (abfd) + 4);
|
||||
// OBSOLETE monitor_expect_prompt (NULL, 0);
|
||||
// OBSOLETE
|
||||
// OBSOLETE monitor_printf ("run\r");
|
||||
// OBSOLETE
|
||||
// OBSOLETE end_time = time (NULL);
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (hashmark)
|
||||
// OBSOLETE putchar_unfiltered ('\n');
|
||||
// OBSOLETE
|
||||
// OBSOLETE report_transfer_performance (data_count, start_time, end_time);
|
||||
// OBSOLETE
|
||||
// OBSOLETE pop_target ();
|
||||
// OBSOLETE push_remote_target (monitor_get_dev_name (), 1);
|
||||
// OBSOLETE
|
||||
// OBSOLETE throw_exception (RETURN_QUIT);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Define the monitor command strings. Since these are passed directly
|
||||
// OBSOLETE through to a printf style function, we may include formatting
|
||||
// OBSOLETE strings. We also need a CR or LF on the end. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* need to pause the monitor for timing reasons, so slow it down */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static char *sparclet_inits[] =
|
||||
// OBSOLETE {"\n\r\r\n", NULL};
|
||||
// OBSOLETE
|
||||
// OBSOLETE static struct monitor_ops sparclet_cmds;
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE init_sparclet_cmds (void)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE sparclet_cmds.flags = MO_CLR_BREAK_USES_ADDR |
|
||||
// OBSOLETE MO_HEX_PREFIX |
|
||||
// OBSOLETE MO_NO_ECHO_ON_OPEN |
|
||||
// OBSOLETE MO_NO_ECHO_ON_SETMEM |
|
||||
// OBSOLETE MO_RUN_FIRST_TIME |
|
||||
// OBSOLETE MO_GETMEM_READ_SINGLE; /* flags */
|
||||
// OBSOLETE sparclet_cmds.init = sparclet_inits; /* Init strings */
|
||||
// OBSOLETE sparclet_cmds.cont = "cont\r"; /* continue command */
|
||||
// OBSOLETE sparclet_cmds.step = "step\r"; /* single step */
|
||||
// OBSOLETE sparclet_cmds.stop = "\r"; /* break interrupts the program */
|
||||
// OBSOLETE sparclet_cmds.set_break = "+bp %x\r"; /* set a breakpoint */
|
||||
// OBSOLETE sparclet_cmds.clr_break = "-bp %x\r"; /* can't use "br" because only 2 hw bps are supported */
|
||||
// OBSOLETE sparclet_cmds.clr_all_break = "-bp %x\r"; /* clear a breakpoint */
|
||||
// OBSOLETE "-bp\r"; /* clear all breakpoints */
|
||||
// OBSOLETE sparclet_cmds.fill = "fill %x -n %x -v %x -b\r"; /* fill (start length val) */
|
||||
// OBSOLETE /* can't use "fi" because it takes words, not bytes */
|
||||
// OBSOLETE /* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */
|
||||
// OBSOLETE sparclet_cmds.setmem.cmdb = "ex %x -b\r%x\rq\r"; /* setmem.cmdb (addr, value) */
|
||||
// OBSOLETE sparclet_cmds.setmem.cmdw = "ex %x -s\r%x\rq\r"; /* setmem.cmdw (addr, value) */
|
||||
// OBSOLETE sparclet_cmds.setmem.cmdl = "ex %x -l\r%x\rq\r"; /* setmem.cmdl (addr, value) */
|
||||
// OBSOLETE sparclet_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */
|
||||
// OBSOLETE sparclet_cmds.setmem.resp_delim = NULL; /*": " *//* setmem.resp_delim */
|
||||
// OBSOLETE sparclet_cmds.setmem.term = NULL; /*"? " *//* setmem.term */
|
||||
// OBSOLETE sparclet_cmds.setmem.term_cmd = NULL; /*"q\r" *//* setmem.term_cmd */
|
||||
// OBSOLETE /* since the parsing of multiple bytes is difficult due to
|
||||
// OBSOLETE interspersed addresses, we'll only read 1 value at a time,
|
||||
// OBSOLETE even tho these can handle a count */
|
||||
// OBSOLETE /* we can use -n to set count to read, but may have to parse? */
|
||||
// OBSOLETE sparclet_cmds.getmem.cmdb = "ex %x -n 1 -b\r"; /* getmem.cmdb (addr, #bytes) */
|
||||
// OBSOLETE sparclet_cmds.getmem.cmdw = "ex %x -n 1 -s\r"; /* getmem.cmdw (addr, #swords) */
|
||||
// OBSOLETE sparclet_cmds.getmem.cmdl = "ex %x -n 1 -l\r"; /* getmem.cmdl (addr, #words) */
|
||||
// OBSOLETE sparclet_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, #dwords) */
|
||||
// OBSOLETE sparclet_cmds.getmem.resp_delim = ": "; /* getmem.resp_delim */
|
||||
// OBSOLETE sparclet_cmds.getmem.term = NULL; /* getmem.term */
|
||||
// OBSOLETE sparclet_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */
|
||||
// OBSOLETE sparclet_cmds.setreg.cmd = "reg %s 0x%x\r"; /* setreg.cmd (name, value) */
|
||||
// OBSOLETE sparclet_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */
|
||||
// OBSOLETE sparclet_cmds.setreg.term = NULL; /* setreg.term */
|
||||
// OBSOLETE sparclet_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */
|
||||
// OBSOLETE sparclet_cmds.getreg.cmd = "reg %s\r"; /* getreg.cmd (name) */
|
||||
// OBSOLETE sparclet_cmds.getreg.resp_delim = " "; /* getreg.resp_delim */
|
||||
// OBSOLETE sparclet_cmds.getreg.term = NULL; /* getreg.term */
|
||||
// OBSOLETE sparclet_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */
|
||||
// OBSOLETE sparclet_cmds.dump_registers = "reg\r"; /* dump_registers */
|
||||
// OBSOLETE sparclet_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */
|
||||
// OBSOLETE sparclet_cmds.supply_register = sparclet_supply_register; /* supply_register */
|
||||
// OBSOLETE sparclet_cmds.load_routine = sparclet_load; /* load_routine */
|
||||
// OBSOLETE sparclet_cmds.load = NULL; /* download command (srecs on console) */
|
||||
// OBSOLETE sparclet_cmds.loadresp = NULL; /* load response */
|
||||
// OBSOLETE sparclet_cmds.prompt = "monitor>"; /* monitor command prompt */
|
||||
// OBSOLETE /* yikes! gdb core dumps without this delimitor!! */
|
||||
// OBSOLETE sparclet_cmds.line_term = "\r"; /* end-of-command delimitor */
|
||||
// OBSOLETE sparclet_cmds.cmd_end = NULL; /* optional command terminator */
|
||||
// OBSOLETE sparclet_cmds.target = &sparclet_ops; /* target operations */
|
||||
// OBSOLETE sparclet_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
|
||||
// OBSOLETE sparclet_cmds.regnames = sparclet_regnames; /* registers names */
|
||||
// OBSOLETE sparclet_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE sparclet_open (char *args, int from_tty)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE monitor_open (args, &sparclet_cmds, from_tty);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE _initialize_sparclet (void)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int i;
|
||||
// OBSOLETE init_sparclet_cmds ();
|
||||
// OBSOLETE
|
||||
// OBSOLETE for (i = 0; i < NUM_REGS; i++)
|
||||
// OBSOLETE if (sparclet_regnames[i][0] == 'c' ||
|
||||
// OBSOLETE sparclet_regnames[i][0] == 'a')
|
||||
// OBSOLETE sparclet_regnames[i] = 0; /* mon can't report c* or a* regs */
|
||||
// OBSOLETE
|
||||
// OBSOLETE sparclet_regnames[0] = 0; /* mon won't report %G0 */
|
||||
// OBSOLETE
|
||||
// OBSOLETE init_monitor_ops (&sparclet_ops);
|
||||
// OBSOLETE sparclet_ops.to_shortname = "sparclet"; /* for the target command */
|
||||
// OBSOLETE sparclet_ops.to_longname = "SPARC Sparclet monitor";
|
||||
// OBSOLETE /* use SW breaks; target only supports 2 HW breakpoints */
|
||||
// OBSOLETE sparclet_ops.to_insert_breakpoint = memory_insert_breakpoint;
|
||||
// OBSOLETE sparclet_ops.to_remove_breakpoint = memory_remove_breakpoint;
|
||||
// OBSOLETE
|
||||
// OBSOLETE sparclet_ops.to_doc =
|
||||
// OBSOLETE "Use a board running the Sparclet debug monitor.\n\
|
||||
// OBSOLETE Specify the serial device it is connected to (e.g. /dev/ttya).";
|
||||
// OBSOLETE
|
||||
// OBSOLETE sparclet_ops.to_open = sparclet_open;
|
||||
// OBSOLETE add_target (&sparclet_ops);
|
||||
// OBSOLETE }
|
||||
|
|
2334
gdb/sparclet-stub.c
2334
gdb/sparclet-stub.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue