From: Jim Wilson Date: Thu, 19 Oct 1995 23:29:59 +0000 (+0000) Subject: Hitachi SH3e, patch to make FP registers debuggable. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a862098505dcd844188d3f590e7afe04f1d023fb;p=binutils-gdb.git Hitachi SH3e, patch to make FP registers debuggable. --- diff --git a/gdb/.Sanitize b/gdb/.Sanitize index c76498c15a5..b2c72a8bb79 100644 --- a/gdb/.Sanitize +++ b/gdb/.Sanitize @@ -459,6 +459,35 @@ else done fi +sh3e_files="ChangeLog" + +if ( echo $* | grep keep\-sh3e > /dev/null ) ; then + for i in $sh3e_files ; do + if test ! -d $i && (grep sanitize-sh3e $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Keeping sh3e stuff in $i + fi + fi + done +else + for i in $sh3e_files ; do + if test ! -d $i && (grep sanitize-sh3e $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Removing traces of \"sh3e\" from $i... + fi + cp $i new + sed '/start\-sanitize\-sh3e/,/end-\sanitize\-sh3e/d' < $i > new + if [ -n "${safe}" -a ! -f .Recover/$i ] ; then + if [ -n "${verbose}" ] ; then + echo Caching $i in .Recover... + fi + mv $i .Recover + fi + mv new $i + fi + done +fi + for i in * ; do if test ! -d $i && (grep sanitize $i > /dev/null) ; then echo '***' Some mentions of Sanitize are still left in $i! 1>&2 diff --git a/gdb/config/sh/.Sanitize b/gdb/config/sh/.Sanitize index 136861f19b8..1a4ce68ddb9 100644 --- a/gdb/config/sh/.Sanitize +++ b/gdb/config/sh/.Sanitize @@ -27,7 +27,35 @@ stub.c Things-to-lose: - Do-last: +sh3e_files="tm-sh.h" + +if ( echo $* | grep keep\-sh3e > /dev/null ) ; then + for i in $sh3e_files ; do + if test ! -d $i && (grep sanitize-sh3e $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Keeping sh3e stuff in $i + fi + fi + done +else + for i in $sh3e_files ; do + if test ! -d $i && (grep sanitize-sh3e $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Removing traces of \"sh3e\" from $i... + fi + cp $i new + sed '/start\-sanitize\-sh3e/,/end-\sanitize\-sh3e/d' < $i > new + if [ -n "${safe}" -a ! -f .Recover/$i ] ; then + if [ -n "${verbose}" ] ; then + echo Caching $i in .Recover... + fi + mv $i .Recover + fi + mv new $i + fi + done +fi + # End of file. diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h index d47cb2ee709..8f56ebb546a 100644 --- a/gdb/config/sh/tm-sh.h +++ b/gdb/config/sh/tm-sh.h @@ -99,6 +99,13 @@ extern CORE_ADDR sh_skip_prologue (); of data in register N. */ #define REGISTER_VIRTUAL_TYPE(N) builtin_type_int +/* start-sanitize-sh3e */ +#undef REGISTER_VIRTUAL_TYPE +#define REGISTER_VIRTUAL_TYPE(N) \ + ((((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) \ + || (N) == FPUL_REGNUM) \ + ? builtin_type_float : builtin_type_int) +/* end-sanitize-sh3e */ /* Initializer for an array of names of registers. Entries beyond the first NUM_REGS are ignored. */ @@ -107,8 +114,22 @@ extern CORE_ADDR sh_skip_prologue (); {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "r10","r11","r12","r13","r14","r15",\ "pc", "pr","gbr","vbr","mach","macl","sr","ticks","stalls","cycles","insts" ,"plr","tlr" } +/* start-sanitize-sh3e */ +#undef REGISTER_NAMES +#define REGISTER_NAMES \ + {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r8", "r9", "r10","r11","r12","r13","r14","r15",\ + "pc", "pr","gbr","vbr","mach","macl", "sr", "fpul", "fpscr", \ + "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", \ + "fr8", "fr9", "fr10","fr11","fr12","fr13","fr14","fr15",\ + } +/* end-sanitize-sh3e */ #define NUM_REGS 28 +/* start-sanitize-sh3e */ +#undef NUM_REGS +#define NUM_REGS 41 +/* end-sanitize-sh3e */ /* Register numbers of various important registers. Note that some of these values are "real" register numbers, @@ -127,7 +148,14 @@ extern CORE_ADDR sh_skip_prologue (); #define MACH_REGNUM 20 #define MACL_REGNUM 21 #define SR_REGNUM 22 -#define NUM_REALREGS 23 +#define NUM_REALREGS 23 +/* start-sanitize-sh3e */ +#define FPUL_REGNUM 23 +#define FP0_REGNUM 25 +#undef NUM_REALREGS +#define NUM_REALREGS 41 +/* end-sanitize-sh3e */ + /* Store the address of the place in which to copy the structure the subroutine will return. This is called from call_function.