gdb: fix building on Darwin 9

TASK_DYLD_INFO_COUNT etc. are not defined.
This commit is contained in:
Mike Frysinger 2013-01-02 21:06:30 +00:00
parent 2e36fbea4c
commit 569283d40e
2 changed files with 13 additions and 1 deletions

View 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.

View 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
/* 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;
}