2004-09-02 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / hpux-thread.c
index b585ca540cee6de6dde601e49da5539ec2f15b9a..5664314225c7541c2476b9d5afafcb537d83f33f 100644 (file)
@@ -131,7 +131,6 @@ find_tcb (ptid_t ptid)
 /* Most target vector functions from here on actually just pass through to
    inftarg.c, as they don't need to do anything specific for threads.  */
 
-/* ARGSUSED */
 static void
 hpux_thread_open (char *arg, int from_tty)
 {
@@ -285,22 +284,22 @@ hpux_thread_fetch_registers (int regno)
        child_ops.to_fetch_registers (regno);
       else
        {
-         unsigned char *buf = alloca (max_register_size (current_gdbarch));
+         unsigned char buf[MAX_REGISTER_SIZE];
          CORE_ADDR sp;
 
          sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
 
          if (regno == FLAGS_REGNUM)
            /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */
-           memset (buf, '\000', REGISTER_RAW_SIZE (regno));
+           memset (buf, '\000', register_size (current_gdbarch, regno));
          else if (regno == SP_REGNUM)
-           store_address (buf, sizeof sp, sp);
+           store_unsigned_integer (buf, sizeof sp, sp);
          else if (regno == PC_REGNUM)
-           read_memory (sp - 20, buf, REGISTER_RAW_SIZE (regno));
+           read_memory (sp - 20, buf, register_size (current_gdbarch, regno));
          else
-           read_memory (sp + regmap[regno], buf, REGISTER_RAW_SIZE (regno));
+           read_memory (sp + regmap[regno], buf, register_size (current_gdbarch, regno));
 
-         supply_register (regno, buf);
+         regcache_raw_supply (current_regcache, regno, buf);
        }
     }
 
@@ -347,7 +346,7 @@ hpux_thread_store_registers (int regno)
        child_ops.to_store_registers (regno);
       else
        {
-         unsigned char *buf = alloca (max_register_size (current_gdbarch));
+         unsigned char buf[MAX_REGISTER_SIZE];
          CORE_ADDR sp;
 
          sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
@@ -357,20 +356,20 @@ hpux_thread_store_registers (int regno)
          else if (regno == SP_REGNUM)
            {
              write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp,
-                           &deprecated_registers[REGISTER_BYTE (regno)],
-                           REGISTER_RAW_SIZE (regno));
+                           &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
+                           register_size (current_gdbarch, regno));
              tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *)
-               (extract_address (&deprecated_registers[REGISTER_BYTE (regno)],
-                                 REGISTER_RAW_SIZE (regno)) + 160);
+               (extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
+                                          register_size (current_gdbarch, regno)) + 160);
            }
          else if (regno == PC_REGNUM)
            write_memory (sp - 20,
-                         &deprecated_registers[REGISTER_BYTE (regno)],
-                         REGISTER_RAW_SIZE (regno));
+                         &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
+                         register_size (current_gdbarch, regno));
          else
            write_memory (sp + regmap[regno],
-                         &deprecated_registers[REGISTER_BYTE (regno)],
-                         REGISTER_RAW_SIZE (regno));
+                         &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
+                         register_size (current_gdbarch, regno));
        }
     }
 
@@ -432,9 +431,10 @@ hpux_thread_notice_signals (ptid_t ptid)
 /* Fork an inferior process, and start debugging it with /proc.  */
 
 static void
-hpux_thread_create_inferior (char *exec_file, char *allargs, char **env)
+hpux_thread_create_inferior (char *exec_file, char *allargs, char **env,
+                            int from_tty)
 {
-  child_ops.to_create_inferior (exec_file, allargs, env);
+  child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
 
   if (hpux_thread_active)
     {
@@ -582,6 +582,6 @@ _initialize_hpux_thread (void)
 
   child_suppress_run = 1;
   /* Hook into new_objfile notification. */
-  target_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook  = hpux_thread_new_objfile;
+  target_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook  = hpux_thread_new_objfile;
 }
This page took 0.027061 seconds and 4 git commands to generate.