* h8300-dep.c (gdb_print_insn_h8300): Handle the H8/S.
authorJeff Law <law@redhat.com>
Tue, 18 Jun 1996 23:29:39 +0000 (23:29 +0000)
committerJeff Law <law@redhat.com>
Tue, 18 Jun 1996 23:29:39 +0000 (23:29 +0000)
        (h8300_command): Likewise.
        (set_machine): Likewise.
        (set_machine_hook): Likewise.
        (_initialize_h8300m): Likewise.

        * config/h8300/tm-h8300.h (h8300smode): Declare.

More sanitized H8/S work.

gdb/.Sanitize
gdb/config/h8300/.Sanitize
gdb/config/h8300/tm-h8300.h
gdb/h8300-tdep.c

index 811a1ad2687689fc46e827c9bfb4c5784c86ec50..6de1d5d7d54696e03785121ef69f1c037a415a53 100644 (file)
@@ -494,6 +494,33 @@ else
        done
 fi
 
+h8s_files="ChangeLog h8300-tdep.c"
+if ( echo $* | grep keep\-h8s > /dev/null ) ; then
+       for i in $h8s_files ; do
+               if test ! -d $i && (grep sanitize-h8s $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping h8s stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $h8s_files ; do
+               if test ! -d $i && (grep sanitize-h8s $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"h8s\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-h8s/,/end-\sanitize\-h8s/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
index b29dad19bc717d0b369fdb21f5ddbcc804ef0442..0c94ff7f812f833ce05741aea11e6ca4ba600fc1 100644 (file)
 
 Do-first:
 
+h8s_files="tm-h8300.h"
+if ( echo $* | grep keep\-h8s > /dev/null ) ; then
+       for i in $h8s_files ; do
+               if test ! -d $i && (grep sanitize-h8s $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping h8s stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $h8s_files ; do
+               if test ! -d $i && (grep sanitize-h8s $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"h8s\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-h8s/,/end-\sanitize\-h8s/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
 # All files listed between the "Things-to-keep:" line and the
 # "Files-to-sed:" line will be kept.  All other files will be removed.
 # Directories listed in this section will have their own Sanitize
index 52a4ef6c61d2e304156f8bd5f6da94e5613bceaf..d09f47b664084f9a627a9eb12df843e96f52b8be 100644 (file)
@@ -22,6 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* 1 if debugging H8/300H application */
 extern int h8300hmode;
+/* start-sanitize-h8s */
+extern int h8300smode;
+/* end-sanitize-h8s */
 
 /* Number of bytes in a word */
 
index 262faa8c9902ad7994ba24004131176ad618f417..cf455d8500c2e02f0c530a121afb5667c05f7a4d 100644 (file)
@@ -121,7 +121,12 @@ gdb_print_insn_h8300 (memaddr, info)
      bfd_vma memaddr;
      disassemble_info *info;
 {
-  if (h8300hmode)
+/* start-sanitize-h8s */
+  if (h8300smode)
+    return print_insn_h8300s (memaddr, info);
+  else
+/* end-sanitize-h8s */
+    if (h8300hmode)
     return print_insn_h8300h (memaddr, info);
   else
     return print_insn_h8300 (memaddr, info);
@@ -427,6 +432,9 @@ h8300_command(args, from_tty)
 {
   extern int h8300hmode;
   h8300hmode = 0;
+/* start-sanitize-h8s */
+  h8300smode = 0;
+/* end-sanitize-h8s */
 }
 
 static void
@@ -434,14 +442,31 @@ h8300h_command(args, from_tty)
 {
   extern int h8300hmode;
   h8300hmode = 1;
+/* start-sanitize-h8s */
+  h8300smode = 0;
+/* end-sanitize-h8s */
+}
+/* start-sanitize-h8s */
+static void
+h8300s_command(args, from_tty)
+{
+  extern int h8300smode;
+  extern int h8300hmode;
+  h8300smode = 1;
+  h8300hmode = 1;
 }
+/* end-santiize-h8s */
+
 
 static void 
 set_machine (args, from_tty)
      char *args;
      int from_tty;
 {
-  printf_unfiltered ("\"set machine\" must be followed by h8300 or h8300h.\n");
+  printf_unfiltered ("\"set machine\" must be followed by h8300, h8300h");
+/* start-sanitize-h8s */
+  printf_unfiltered ("or h8300s");
+/* end-sanitize-h8s */
   help_list (setmemorylist, "set memory ", -1, gdb_stdout);
 }
 
@@ -455,7 +480,28 @@ static void
 set_machine_hook (filename)
      char *filename;
 {
-  h8300hmode = (bfd_get_mach (exec_bfd) == bfd_mach_h8300h);
+/* start-sanitize-h8s */
+  if (bfd_get_mach (exec_bfd) == bfd_mach_h8300s)
+    {
+      h8300smode = 1;
+      h8300hmode = 1;
+    }
+  else 
+/* end-sanitize-h8s */
+    if (bfd_get_mach (exec_bfd) == bfd_mach_h8300h)
+    {
+/* start-sanitize-h8s */
+      h8300smode = 0;
+/* end-sanitize-h8s */
+      h8300hmode = 1;
+    }
+  else
+    {
+/* start-sanitize-h8s */
+      h8300smode = 0;
+/* end-sanitize-h8s */
+      h8300hmode = 0;
+    }
 }
 
 void
@@ -471,6 +517,11 @@ _initialize_h8300m ()
   add_cmd ("h8300h", class_support, h8300h_command,
           "Set machine to be H8/300H.", &setmemorylist);
 
+/* start-sanitize-h8s */
+  add_cmd ("h8300s", class_support, h8300s_command,
+          "Set machine to be H8/300S.", &setmemorylist);
+/* end-sanitize-h8s */
+
   /* Add a hook to set the machine type when we're loading a file. */
 
   specify_exec_file_hook(set_machine_hook);