gdb: fix building on Darwin 9
authorMike Frysinger <vapier@gentoo.org>
Wed, 2 Jan 2013 21:06:30 +0000 (21:06 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 2 Jan 2013 21:06:30 +0000 (21:06 +0000)
TASK_DYLD_INFO_COUNT etc. are not defined.

gdb/ChangeLog
gdb/darwin-nat.c

index 7ad74ea757bc0673d334dd81cf3deede45d353e5..6e840dc748a3e6b1a742ce6442cbeb1afb7f5c92 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-02  Iain Sandoe  <developer@sandoe-acoustics.co.uk>
+
+       * darwin-nat.c (darwin_read_dyld_info): Only build if
+       TASK_DYLD_INFO_COUNT is defined.
+       (darwin_xfer_partial): Call darwin_read_dyld_info only if
+       TASK_DYLD_INFO_COUNT is defined.
+
 2013-01-02  Tom Tromey  <tromey@redhat.com>
 
        * symfile.h (struct ecoff_debug_hack): Remove.
index 0d18305ca11f730ab4daf781b4a84c890cdff75d..03070481e0bfa39518c0a6ab73b6d91b04c9e070 100644 (file)
@@ -1816,8 +1816,10 @@ out:
 
 /* Read LENGTH bytes at offset ADDR of task_dyld_info for TASK, and copy them
    to RDADDR.
-   Return 0 on failure; number of bytes read / writen otherwise.  */
+   Return 0 on failure; number of bytes read / written otherwise.  */
 
+#ifndef TASK_DYLD_INFO_COUNT
+/* This is not available in Darwin 9.  */
 static int
 darwin_read_dyld_info (task_t task, CORE_ADDR addr, char *rdaddr, int length)
 {
@@ -1839,6 +1841,7 @@ darwin_read_dyld_info (task_t task, CORE_ADDR addr, char *rdaddr, int length)
   memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
   return length;
 }
+#endif
 
 \f
 /* Return 0 on failure, number of bytes handled otherwise.  TARGET
@@ -1881,6 +1884,7 @@ darwin_xfer_partial (struct target_ops *ops,
     case TARGET_OBJECT_MEMORY:
       return darwin_read_write_inferior (inf->private->task, offset,
                                          readbuf, writebuf, len);
+#ifdef TASK_DYLD_INFO_COUNT
     case TARGET_OBJECT_DARWIN_DYLD_INFO:
       if (writebuf != NULL || readbuf == NULL)
         {
@@ -1888,6 +1892,7 @@ darwin_xfer_partial (struct target_ops *ops,
           return -1;
         }
       return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
+#endif
     default:
       return -1;
     }