revert 1.9. Not approved.
[deliverable/binutils-gdb.git] / gdb / linux-thread.c
index dc91edf6a1c45bc542c749ff58959cfd32a1a28c..146481c6ac8eaed9126371453767ab700795d728 100644 (file)
@@ -378,25 +378,22 @@ linuxthreads_find_trap (pid, stop)
 
 /* Cleanup stub for save_inferior_pid.  */
 static void
-restore_inferior_pid (arg)
-    void *arg;
+restore_inferior_pid (void *arg)
 {
-#if TARGET_PTR_BIT > TARGET_INT_BIT
-  inferior_pid = (int) ((long) arg);
-#else
-  inferior_pid = (int) arg;
-#endif
+  int *saved_pid_ptr = arg;
+  inferior_pid = *saved_pid_ptr;
+  free (arg);
 }
 
 /* Register a cleanup to restore the value of inferior_pid.  */
 static struct cleanup *
-save_inferior_pid ()
+save_inferior_pid (void)
 {
-#if TARGET_PTR_BIT > TARGET_INT_BIT
-  return make_cleanup (restore_inferior_pid, (void *) ((long) inferior_pid));
-#else
-  return make_cleanup (restore_inferior_pid, (void *) inferior_pid);
-#endif
+  int *saved_pid_ptr;
+  
+  saved_pid_ptr = xmalloc (sizeof (int));
+  *saved_pid_ptr = inferior_pid;
+  return make_cleanup (restore_inferior_pid, saved_pid_ptr);
 }
 
 static void
@@ -1129,7 +1126,7 @@ linuxthreads_attach (args, from_tty)
   linuxthreads_breakpoints_inserted = 1;
   linuxthreads_breakpoint_last = -1;
   linuxthreads_wait_last = -1;
-  linuxthreads_exit_status = __W_STOPCODE(0);
+  WSETSTOP (linuxthreads_exit_status, 0);
 
   child_ops.to_attach (args, from_tty);
 
@@ -1189,7 +1186,7 @@ linuxthreads_detach (args, from_tty)
          linuxthreads_find_trap (inferior_pid, 1);
 
          linuxthreads_wait_last = -1;
-         linuxthreads_exit_status = __W_STOPCODE(0);
+         WSETSTOP (linuxthreads_exit_status, 0);
        }
 
       linuxthreads_inferior_pid = 0;
@@ -1601,7 +1598,7 @@ Use the \"file\" or \"exec-file\" command.");
   linuxthreads_breakpoints_inserted = 1;
   linuxthreads_breakpoint_last = -1;
   linuxthreads_wait_last = -1;
-  linuxthreads_exit_status = __W_STOPCODE(0);
+  WSETSTOP (linuxthreads_exit_status, 0);
   
   if (linuxthreads_max)
     linuxthreads_attach_pending = 1;
This page took 0.024148 seconds and 4 git commands to generate.