/* Darwin support for GDB, the GNU debugger.
- Copyright (C) 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
Contributed by AdaCore.
#define PAGE_ROUND(x) PAGE_TRUNC((x) + mach_page_size - 1)
/* This controls output of inferior debugging. */
-static int darwin_debug_flag = 0;
+static unsigned int darwin_debug_flag = 0;
/* Create a __TEXT __info_plist section in the executable so that gdb could
be signed. This is required to get an authorization for task_for_pid.
/* 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. */
+#ifdef 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)
{
memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
return length;
}
+#endif
\f
/* Return 0 on failure, number of bytes handled otherwise. TARGET
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)
{
return -1;
}
return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
+#endif
default:
return -1;
}
inferior_debug (2, _("GDB task: 0x%lx, pid: %d\n"), mach_task_self (),
getpid ());
- add_setshow_zinteger_cmd ("darwin", class_obscure,
- &darwin_debug_flag, _("\
+ add_setshow_zuinteger_cmd ("darwin", class_obscure,
+ &darwin_debug_flag, _("\
Set if printing inferior communication debugging statements."), _("\
Show if printing inferior communication debugging statements."), NULL,
- NULL, NULL,
- &setdebuglist, &showdebuglist);
+ NULL, NULL,
+ &setdebuglist, &showdebuglist);
add_setshow_boolean_cmd ("mach-exceptions", class_support,
&enable_mach_exceptions, _("\