* inflow.c (O_NOCTTY): Define to zero if not already defined.
[deliverable/binutils-gdb.git] / gdb / remote-e7000.c
index 3b9a9414dde75a2309a59c7b4e28c35bacaed311..965ea9718cf97fc7ef8402167d8a75e0cdb31958 100644 (file)
@@ -1,7 +1,7 @@
-/* Remote debugging interface for Hitachi E7000 ICE, for GDB
+/* Remote debugging interface for Renesas E7000 ICE, for GDB
 
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support. 
 
@@ -24,8 +24,8 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* The E7000 is an in-circuit emulator for the Hitachi H8/300-H and
-   Hitachi-SH processor.  It has serial port and a lan port.  
+/* The E7000 is an in-circuit emulator for the Renesas H8/300-H and
+   Renesas-SH processor.  It has serial port and a lan port.  
 
    The monitor command set makes it difficult to load large ammounts of
    data over the lan without using ftp - so try not to issue load
@@ -362,7 +362,7 @@ get_hex_regs (int n, int regno)
       val = 0;
       for (j = 0; j < 8; j++)
        val = (val << 4) + get_hex_digit (j == 0);
-      supply_register (regno++, (char *) &val);
+      regcache_raw_supply (current_regcache, regno++, (char *) &val);
     }
 }
 #endif
@@ -371,7 +371,8 @@ get_hex_regs (int n, int regno)
    user types "run" after having attached.  */
 
 static void
-e7000_create_inferior (char *execfile, char *args, char **env)
+e7000_create_inferior (char *execfile, char *args, char **env,
+                      int from_tty)
 {
   int entry_pt;
 
@@ -629,7 +630,7 @@ e7000_start_remote (void *dummy)
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  print_stack_frame (get_selected_frame (), -1, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC);
 
   return 1;
 }
@@ -657,10 +658,6 @@ e7000_open (char *args, int from_tty)
     }
   serial_raw (e7000_desc);
 
-#ifdef GDB_TARGET_IS_H8300
-  h8300hmode = 1;
-#endif
-
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it
      (we'd be in an inconsistent state otherwise).  */
@@ -781,11 +778,11 @@ gbyte (void)
   return (high << 4) + low;
 }
 
-void
+static void
 fetch_regs_from_dump (int (*nextchar) (), char *want)
 {
   int regno;
-  char *buf = alloca (max_register_size (current_gdbarch));
+  char buf[MAX_REGISTER_SIZE];
 
   int thischar = nextchar ();
 
@@ -882,9 +879,9 @@ fetch_regs_from_dump (int (*nextchar) (), char *want)
                internal_error (__FILE__, __LINE__, "failed internal consistency check");
            }
          store_signed_integer (buf,
-                               REGISTER_RAW_SIZE (regno),
+                               register_size (current_gdbarch, regno),
                                (LONGEST) get_hex (&thischar));
-         supply_register (regno, buf);
+         regcache_raw_supply (current_regcache, regno, buf);
          break;
        }
     }
@@ -909,15 +906,18 @@ e7000_fetch_registers (void)
          wanted = want_sh3;
        }
     }
-#ifdef GDB_TARGET_IS_H8300
   if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
     {
-      if (h8300smode)
-       wanted = want_h8300s;
-      else
-       wanted = want_h8300h;
+      wanted = want_h8300h;
+      switch (TARGET_ARCHITECTURE->mach)
+       {
+       case bfd_mach_h8300s:
+       case bfd_mach_h8300sn:
+       case bfd_mach_h8300sx:
+       case bfd_mach_h8300sxn:
+         wanted = want_h8300s;
+       }
     }
-#endif
 
   fetch_regs_from_dump (gch, wanted);
 
@@ -926,7 +926,7 @@ e7000_fetch_registers (void)
     {
       int buf = 0;
 
-      supply_register (regno, (char *) (&buf));
+      regcache_raw_supply (current_regcache, regno, (char *) (&buf));
     }
 }
 
@@ -1569,7 +1569,7 @@ e7000_load (char *args, int from_tty)
          file_ptr fptr;
 
          section_address = bfd_get_section_vma (pbfd, section);
-         section_size = bfd_get_section_size_before_reloc (section);
+         section_size = bfd_get_section_size (section);
 
          if (!quiet)
            printf_filtered ("[Loading section %s at 0x%s (%s bytes)]\n",
@@ -1873,7 +1873,7 @@ why_stop (void)
 /* Suck characters, if a string match, then return the strings index
    otherwise echo them.  */
 
-int
+static int
 expect_n (char **strings)
 {
   char *(ptr[10]);
@@ -1964,9 +1964,9 @@ sub2_from_pc (void)
   char buf2[200];
 
   store_signed_integer (buf,
-                       REGISTER_RAW_SIZE (PC_REGNUM),
+                       register_size (current_gdbarch, PC_REGNUM),
                        read_register (PC_REGNUM) - 2);
-  supply_register (PC_REGNUM, buf);
+  regcache_raw_supply (current_regcache, PC_REGNUM, buf);
   sprintf (buf2, ".PC %s\r", phex_nz (read_register (PC_REGNUM), 0));
   puts_e7000debug (buf2);
 }
@@ -2046,22 +2046,25 @@ e7000_wait (ptid_t ptid, struct target_waitstatus *status)
          wanted_nopc = want_nopc_sh3;
        }
     }
-#ifdef GDB_TARGET_IS_H8300
   if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
     {
-      if (h8300smode)
-       wanted_nopc = want_nopc_h8300s;
-      else
-       wanted_nopc = want_nopc_h8300h;
+      wanted_nopc = want_nopc_h8300h;
+      switch (TARGET_ARCHITECTURE->mach)
+       {
+       case bfd_mach_h8300s:
+       case bfd_mach_h8300sn:
+       case bfd_mach_h8300sx:
+       case bfd_mach_h8300sxn:
+         wanted_nopc = want_nopc_h8300s;
+       }
     }
-#endif
   fetch_regs_from_dump (gch, wanted_nopc);
 
   /* And supply the extra ones the simulator uses */
   for (regno = NUM_REALREGS; regno < NUM_REGS; regno++)
     {
       int buf = 0;
-      supply_register (regno, (char *) &buf);
+      regcache_raw_supply (current_regcache, regno, (char *) &buf);
     }
 
   stop_reason = why_stop ();
@@ -2131,8 +2134,8 @@ static void
 init_e7000_ops (void)
 {
   e7000_ops.to_shortname = "e7000";
-  e7000_ops.to_longname = "Remote Hitachi e7000 target";
-  e7000_ops.to_doc = "Use a remote Hitachi e7000 ICE connected by a serial line;\n\
+  e7000_ops.to_longname = "Remote Renesas e7000 target";
+  e7000_ops.to_doc = "Use a remote Renesas e7000 ICE connected by a serial line;\n\
 or a network connection.\n\
 Arguments are the name of the device for the serial line,\n\
 the speed to connect at in bits per second.\n\
@@ -2165,6 +2168,8 @@ target e7000 foobar";
   e7000_ops.to_magic = OPS_MAGIC;
 };
 
+extern initialize_file_ftype _initialize_remote_e7000; /* -Wmissing-prototypes */
+
 void
 _initialize_remote_e7000 (void)
 {
@@ -2183,8 +2188,9 @@ _initialize_remote_e7000 (void)
   add_com ("drain", class_obscure, e7000_drain_command,
           "Drain pending e7000 text buffers.");
 
-  add_show_from_set (add_set_cmd ("usehardbreakpoints", no_class,
-                               var_integer, (char *) &use_hard_breakpoints,
-       "Set use of hardware breakpoints for all breakpoints.\n", &setlist),
-                    &showlist);
+  deprecated_add_show_from_set
+    (add_set_cmd ("usehardbreakpoints", no_class,
+                 var_integer, (char *) &use_hard_breakpoints, "\
+Set use of hardware breakpoints for all breakpoints.\n", &setlist),
+     &showlist);
 }
This page took 0.029031 seconds and 4 git commands to generate.