Replace ../include/wait.h with gdb_wait.h.
[deliverable/binutils-gdb.git] / gdb / gnu-nat.c
index 9a5b927c806ffc8a3a454727693f4a68f1c2e0ec..5f609edea1a7f04bca7e7976ee25af6a0dc3602d 100644 (file)
@@ -1,4 +1,4 @@
-/* Interface GDB to the GNU Hurd
+/* Interface GDB to the GNU Hurd.
    Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -60,7 +60,7 @@
 #include "value.h"
 #include "language.h"
 #include "target.h"
-#include "wait.h"
+#include "gdb_wait.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
 
@@ -88,7 +88,6 @@ int gnu_debug_flag = 0;
 
 extern struct target_ops gnu_ops;
 
-int inf_update_procs (struct inf *inf);
 struct inf *make_inf ();
 void inf_clear_wait (struct inf *inf);
 void inf_cleanup (struct inf *inf);
@@ -116,7 +115,6 @@ void inf_continue (struct inf *inf);
        debug ("{inf %d %p}: " msg, __inf->pid, __inf , ##args); } while (0)
 
 void proc_abort (struct proc *proc, int force);
-thread_state_t proc_get_state (struct proc *proc, int force);
 struct proc *make_proc (struct inf *inf, mach_port_t port, int tid);
 struct proc *_proc_free (struct proc *proc);
 int proc_update_sc (struct proc *proc);
@@ -126,7 +124,6 @@ static mach_port_t _proc_get_exc_port (struct proc *proc);
 void proc_steal_exc_port (struct proc *proc, mach_port_t exc_port);
 void proc_restore_exc_port (struct proc *proc);
 int proc_trace (struct proc *proc, int set);
-char *proc_string (struct proc *proc);
 
 /* Evaluate RPC_EXPR in a scope with the variables MSGPORT and REFPORT bound
    to INF's msg port and task port respectively.  If it has no msg port,
@@ -2014,7 +2011,7 @@ gnu_create_inferior (exec_file, allargs, env)
     inf_restore_exc_ports (inf);
 
   /* Here we go!  */
-  proceed ((CORE_ADDR) - 1, 0, 0);
+  proceed ((CORE_ADDR) -1, 0, 0);
 }
 
 /* Mark our target-struct as eligible for stray "run" and "attach"
@@ -2415,6 +2412,35 @@ gnu_xfer_memory (memaddr, myaddr, len, write, target)
     }
 }
 \f
+/* Return printable description of proc.  */
+static char *
+proc_string (struct proc *proc)
+{
+  static char tid_str[80];
+  if (proc_is_task (proc))
+    sprintf (tid_str, "process %d", proc->inf->pid);
+  else
+    sprintf (tid_str, "thread %d.%d",
+            proc->inf->pid, pid_to_thread_id (proc->tid));
+  return tid_str;
+}
+
+static char *
+gnu_pid_to_str (int tid)
+{
+  struct inf *inf = current_inferior;
+  struct proc *thread = inf_tid_to_thread (inf, tid);
+
+  if (thread)
+    return proc_string (thread);
+  else
+    {
+      static char tid_str[80];
+      sprintf (tid_str, "bogus thread id %d", tid);
+      return tid_str;
+    }
+}
+\f
 extern void gnu_store_registers (int regno);
 extern void gnu_fetch_registers (int regno);
 
@@ -2473,6 +2499,7 @@ init_gnu_ops (void)
   gnu_ops.to_can_run = gnu_can_run;    /* to_can_run */
   gnu_ops.to_notice_signals = 0;       /* to_notice_signals */
   gnu_ops.to_thread_alive = gnu_thread_alive;  /* to_thread_alive */
+  gnu_ops.to_pid_to_str = gnu_pid_to_str;   /* to_pid_to_str */
   gnu_ops.to_stop = gnu_stop;  /* to_stop */
   gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file;  /* to_pid_to_exec_file */
   gnu_ops.to_core_file_to_sym_file = NULL;
@@ -2488,35 +2515,6 @@ init_gnu_ops (void)
   gnu_ops.to_magic = OPS_MAGIC;        /* to_magic */
 }                              /* init_gnu_ops */
 \f
-/* Return printable description of proc.  */
-char *
-proc_string (struct proc *proc)
-{
-  static char tid_str[80];
-  if (proc_is_task (proc))
-    sprintf (tid_str, "process %d", proc->inf->pid);
-  else
-    sprintf (tid_str, "thread %d.%d",
-            proc->inf->pid, pid_to_thread_id (proc->tid));
-  return tid_str;
-}
-
-char *
-gnu_target_pid_to_str (int tid)
-{
-  struct inf *inf = current_inferior;
-  struct proc *thread = inf_tid_to_thread (inf, tid);
-
-  if (thread)
-    return proc_string (thread);
-  else
-    {
-      static char tid_str[80];
-      sprintf (tid_str, "bogus thread id %d", tid);
-      return tid_str;
-    }
-}
-\f
 /* User task commands.  */
 
 struct cmd_list_element *set_task_cmd_list = 0;
This page took 0.025298 seconds and 4 git commands to generate.