*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / gnu-nat.c
index f17d001bc0ba26efb7f8e8d21d2a44b65c5d26ec..4e0eef50ec49a6c15c69d8f783edf8cc5c3f4947 100644 (file)
@@ -1,5 +1,5 @@
 /* Interface GDB to the GNU Hurd.
-   Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2006
+   Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -10,7 +10,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -19,9 +19,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <ctype.h>
@@ -45,6 +43,9 @@
 #include <hurd/msg.h>
 #include <hurd/msg_request.h>
 #include <hurd/process.h>
+/* Defined in <hurd/process.h>, but we need forward declarations from
+   <hurd/process_request.h> as well.  */
+#undef _process_user_
 #include <hurd/process_request.h>
 #include <hurd/signal.h>
 #include <hurd/sigpreempt.h>
@@ -1050,7 +1051,10 @@ inf_validate_procs (struct inf *inf)
            proc_debug (thread, "died!");
            thread->port = MACH_PORT_NULL;
            thread = _proc_free (thread);       /* THREAD is dead.  */
-           (last ? last->next : inf->threads) = thread;
+           if (last)
+             last->next = thread;
+           else
+             inf->threads = thread;
          }
       }
 
@@ -1063,7 +1067,10 @@ inf_validate_procs (struct inf *inf)
          /* THREADS[I] is a thread we don't know about yet!  */
          {
            thread = make_proc (inf, threads[i], next_thread_id++);
-           (last ? last->next : inf->threads) = thread;
+           if (last)
+             last->next = thread;
+           else
+             inf->threads = thread;
            last = thread;
            proc_debug (thread, "new thread: %d", threads[i]);
            add_thread (pid_to_ptid (thread->tid));     /* Tell GDB's generic thread code.  */
@@ -1972,7 +1979,7 @@ gnu_resume (ptid_t tid, int step, enum target_signal sig)
     {
       struct proc *thread = inf_tid_to_thread (inf, PIDGET (tid));
       if (!thread)
-       error (_("Can't run single thread id %d: no such thread!"));
+       error (_("Can't run single thread id %d: no such thread!"), inf->pid);
       inf_debug (inf, "running one thread: %d/%d", inf->pid, thread->tid);
       inf_set_threads_resume_sc (inf, thread, 0);
     }
@@ -2198,11 +2205,8 @@ gnu_terminal_init_inferior (void)
    that registers contains all the registers from the program being
    debugged.  */
 static void
-gnu_prepare_to_store (void)
+gnu_prepare_to_store (struct regcache *regcache)
 {
-#ifdef CHILD_PREPARE_TO_STORE
-  CHILD_PREPARE_TO_STORE ();
-#endif
 }
 
 static void
@@ -2251,7 +2255,7 @@ gnu_read_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
   if (err)
     return 0;
 
-  err = hurd_safe_copyin (myaddr, (void *) addr - low_address + copied, length);
+  err = hurd_safe_copyin (myaddr, (void *) (addr - low_address + copied), length);
   if (err)
     {
       warning (_("Read from inferior faulted: %s"), safe_strerror (err));
@@ -2306,7 +2310,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
 
   deallocate++;
 
-  err = hurd_safe_copyout ((void *) addr - low_address + copied,
+  err = hurd_safe_copyout ((void *) (addr - low_address + copied),
                           myaddr, length);
   CHK_GOTO_OUT ("Write to inferior faulted", err);
 
@@ -2439,7 +2443,7 @@ out:
 /* Return 0 on failure, number of bytes handled otherwise.  TARGET
    is ignored. */
 static int
-gnu_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+gnu_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
                 struct mem_attrib *attrib,
                 struct target_ops *target)
 {
@@ -2575,8 +2579,8 @@ gnu_pid_to_str (ptid_t ptid)
 }
 
 \f
-extern void gnu_store_registers (int regno);
-extern void gnu_fetch_registers (int regno);
+extern void gnu_store_registers (struct regcache *regcache, int regno);
+extern void gnu_fetch_registers (struct regcache *regcache, int regno);
 
 struct target_ops gnu_ops;
 
This page took 0.026343 seconds and 4 git commands to generate.