2004-08-08 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / v850ice.c
index 704d2a2f895b6868e2187325af6f020a5b484be0..21daeea6f00029acd720b8a5c50505056f24fc12 100644 (file)
@@ -50,14 +50,6 @@ struct MessageIO
 /* Prototypes for functions located in other files */
 extern void break_command (char *, int);
 
-extern void stepi_command (char *, int);
-
-extern void nexti_command (char *, int);
-
-extern void continue_command (char *, int);
-
-extern int (*ui_loop_hook) (int);
-
 /* Prototypes for local functions */
 static int init_hidden_window (void);
 
@@ -73,7 +65,8 @@ static void v850ice_prepare_to_store (void);
 
 static void v850ice_fetch_registers (int regno);
 
-static void v850ice_resume (int pid, int step, enum target_signal siggnal);
+static void v850ice_resume (ptid_t ptid, int step,
+                            enum target_signal siggnal);
 
 static void v850ice_open (char *name, int from_tty);
 
@@ -85,7 +78,8 @@ static void v850ice_store_registers (int regno);
 
 static void v850ice_mourn (void);
 
-static int v850ice_wait (int pid, struct target_waitstatus *status);
+static ptid_t v850ice_wait (ptid_t ptid,
+                                  struct target_waitstatus *status);
 
 static void v850ice_kill (void);
 
@@ -293,13 +287,13 @@ v850ice_wndproc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
          result = TRUE;
          break;
        case STATE_CHANGE_STEPI:
-         if (!catch_errors ((catch_errors_ftype *) ice_stepi, (PTR) (int) lParam, "",
+         if (!catch_errors ((catch_errors_ftype *) ice_stepi, (int) lParam, "",
                             RETURN_MASK_ALL))
            printf_unfiltered ("stepi errored\n");
          result = TRUE;
          break;
        case STATE_CHANGE_NEXTI:
-         if (!catch_errors ((catch_errors_ftype *) ice_nexti, (PTR) (int) lParam, "",
+         if (!catch_errors ((catch_errors_ftype *) ice_nexti, (int) lParam, "",
                             RETURN_MASK_ALL))
            printf_unfiltered ("nexti errored\n");
          result = TRUE;
@@ -367,7 +361,7 @@ v850ice_open (char *name, int from_tty)
      target is active.  These functions should be split out into seperate
      variables, especially since GDB will someday have a notion of debugging
      several processes.  */
-  inferior_pid = 42000;
+  inferior_ptid = pid_to_ptid (42000);
 
   start_remote ();
   return;
@@ -375,7 +369,6 @@ v850ice_open (char *name, int from_tty)
 
 /* Clean up connection to a remote debugger.  */
 
-/* ARGSUSED */
 static void
 v850ice_close (int quitting)
 {
@@ -383,7 +376,7 @@ v850ice_close (int quitting)
     {
       UnregisterClient ();
       ice_open = 0;
-      inferior_pid = 0;
+      inferior_ptid = null_ptid;
     }
 }
 
@@ -409,7 +402,7 @@ v850ice_detach (char *args, int from_tty)
 /* Tell the remote machine to resume.  */
 
 static void
-v850ice_resume (int pid, int step, enum target_signal siggnal)
+v850ice_resume (ptid_t ptid, int step, enum target_signal siggnal)
 {
   long retval;
   char buf[256];
@@ -432,8 +425,8 @@ v850ice_resume (int pid, int step, enum target_signal siggnal)
    Returns "pid" (though it's not clear what, if anything, that
    means in the case of this target).  */
 
-static int
-v850ice_wait (int pid, struct target_waitstatus *status)
+static ptid_t
+v850ice_wait (ptid_t ptid, struct target_waitstatus *status)
 {
   long v850_status;
   char buf[256];
@@ -448,7 +441,7 @@ v850ice_wait (int pid, struct target_waitstatus *status)
     {
       if (count++ % 100000)
        {
-         ui_loop_hook (0);
+         deprecated_ui_loop_hook (0);
          count = 0;
        }
 
@@ -485,7 +478,7 @@ v850ice_wait (int pid, struct target_waitstatus *status)
     }
   while (!done);
 
-  return inferior_pid;
+  return inferior_ptid;
 }
 
 static int
@@ -539,8 +532,8 @@ v850ice_fetch_registers (int regno)
     error ("v850ice_fetch_registers (%d):  bad value from ICE: %s.",
           regno, val);
 
-  store_unsigned_integer (val, REGISTER_RAW_SIZE (regno), regval);
-  supply_register (regno, val);
+  store_unsigned_integer (val, register_size (current_gdbarch, regno), regval);
+  regcache_raw_supply (current_regcache, regno, val);
 }
 
 /* Store register REGNO, or all registers if REGNO == -1, from the contents
@@ -564,8 +557,8 @@ v850ice_store_registers (int regno)
       return;
     }
 
-  regval = extract_unsigned_integer (&registers[REGISTER_BYTE (regno)],
-                                    REGISTER_RAW_SIZE (regno));
+  regval = extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
+                                    register_size (current_gdbarch, regno));
   strcpy (cmd, "reg ");
   if (!convert_register (regno, &cmd[4]))
     return;
@@ -591,7 +584,6 @@ v850ice_prepare_to_store (void)
 
    We can only read/write MAX_BLOCK_SIZE bytes at a time, though, or the DLL
    dies.  */
-/* ARGSUSED */
 static int
 v850ice_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
                     int should_write, struct target_ops *target)
@@ -752,7 +744,7 @@ static void
 v850ice_kill (void)
 {
   target_mourn_inferior ();
-  inferior_pid = 0;
+  inferior_ptid = null_ptid;
 }
 
 static void
@@ -901,14 +893,9 @@ init_850ice_ops (void)
   v850ice_ops.to_doc = "Debug a system controlled by a NEC 850 ICE.";
   v850ice_ops.to_open = v850ice_open;
   v850ice_ops.to_close = v850ice_close;
-  v850ice_ops.to_attach = NULL;
-  v850ice_ops.to_post_attach = NULL;
-  v850ice_ops.to_require_attach = NULL;
   v850ice_ops.to_detach = v850ice_detach;
-  v850ice_ops.to_require_detach = NULL;
   v850ice_ops.to_resume = v850ice_resume;
   v850ice_ops.to_wait = v850ice_wait;
-  v850ice_ops.to_post_wait = NULL;
   v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
   v850ice_ops.to_store_registers = v850ice_store_registers;
   v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
@@ -916,30 +903,16 @@ init_850ice_ops (void)
   v850ice_ops.to_files_info = v850ice_files_info;
   v850ice_ops.to_insert_breakpoint = v850ice_insert_breakpoint;
   v850ice_ops.to_remove_breakpoint = v850ice_remove_breakpoint;
-  v850ice_ops.to_terminal_init = NULL;
-  v850ice_ops.to_terminal_inferior = NULL;
-  v850ice_ops.to_terminal_ours_for_output = NULL;
-  v850ice_ops.to_terminal_ours = NULL;
-  v850ice_ops.to_terminal_info = NULL;
   v850ice_ops.to_kill = v850ice_kill;
   v850ice_ops.to_load = v850ice_load;
-  v850ice_ops.to_lookup_symbol = NULL;
-  v850ice_ops.to_create_inferior = NULL;
   v850ice_ops.to_mourn_inferior = v850ice_mourn;
-  v850ice_ops.to_can_run = 0;
-  v850ice_ops.to_notice_signals = 0;
-  v850ice_ops.to_thread_alive = NULL;
   v850ice_ops.to_stop = v850ice_stop;
-  v850ice_ops.to_pid_to_exec_file = NULL;
   v850ice_ops.to_stratum = process_stratum;
-  v850ice_ops.DONT_USE = NULL;
   v850ice_ops.to_has_all_memory = 1;
   v850ice_ops.to_has_memory = 1;
   v850ice_ops.to_has_stack = 1;
   v850ice_ops.to_has_registers = 1;
   v850ice_ops.to_has_execution = 1;
-  v850ice_ops.to_sections = NULL;
-  v850ice_ops.to_sections_end = NULL;
   v850ice_ops.to_magic = OPS_MAGIC;
 }
 
This page took 0.027521 seconds and 4 git commands to generate.