PR ld/12549
[binutils-gdb.git] / gdb / inf-ptrace.c
index 8f0d08b7a63a0974e0cbbf92e86f500df00d5ef5..27bbf4d7deca521beaa6f602d59b2d2db336f5ad 100644 (file)
@@ -1,8 +1,6 @@
 /* Low-level child interface to ptrace.
 
-   Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-   1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1988-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -251,7 +249,7 @@ inf_ptrace_attach (struct target_ops *ops, char *args, int from_tty)
 
 #ifdef PT_GET_PROCESS_STATE
 
-void
+static void
 inf_ptrace_post_attach (int pid)
 {
   ptrace_event_t pe;
@@ -343,7 +341,7 @@ inf_ptrace_stop (ptid_t ptid)
 
 static void
 inf_ptrace_resume (struct target_ops *ops,
-                  ptid_t ptid, int step, enum target_signal signal)
+                  ptid_t ptid, int step, enum gdb_signal signal)
 {
   pid_t pid = ptid_get_pid (ptid);
   int request;
@@ -372,7 +370,7 @@ inf_ptrace_resume (struct target_ops *ops,
      where it was.  If GDB wanted it to start some other way, we have
      already written a new program counter value to the child.  */
   errno = 0;
-  ptrace (request, pid, (PTRACE_TYPE_ARG3)1, target_signal_to_host (signal));
+  ptrace (request, pid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal));
   if (errno != 0)
     perror_with_name (("ptrace"));
 }
@@ -409,7 +407,7 @@ inf_ptrace_wait (struct target_ops *ops,
 
          /* Claim it exited with unknown signal.  */
          ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
-         ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+         ourstatus->value.sig = GDB_SIGNAL_UNKNOWN;
          return inferior_ptid;
        }
 
@@ -590,7 +588,7 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
        struct ptrace_io_desc piod;
 
        if (writebuf)
-               return -1;
+         return -1;
        piod.piod_op = PIOD_READ_AUXV;
        piod.piod_addr = readbuf;
        piod.piod_offs = (void *) (long) offset;
@@ -650,11 +648,11 @@ static int
 inf_ptrace_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
                       gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
 {
-  struct type *int_type = builtin_type (target_gdbarch)->builtin_int;
-  struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
+  struct type *int_type = builtin_type (target_gdbarch ())->builtin_int;
+  struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
   const int sizeof_auxv_type = TYPE_LENGTH (int_type);
   const int sizeof_auxv_val = TYPE_LENGTH (ptr_type);
-  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   gdb_byte *ptr = *readptr;
 
   if (endptr == ptr)