This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: gdb-patches at sourceware dot org, Tristan Gingold <gingold at adacore dot com>, Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
- Date: Mon, 24 Dec 2012 08:26:57 +0400
- Subject: Re: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10.
- References: <59ABFF71-CA26-452C-B9B2-9B0FC6AAE2BD@sandoe-acoustics.co.uk> <03DE2A59-DA13-4F7C-B757-533D4AF5F1DD@adacore.com> <201212232258.05972.vapier@gentoo.org>
> how about this instead. it localizes the #ifdef and has a comment.
Tristan being on holiday, I will take over this week. This looks
OK to me with one tiny request: Update the function documentation
about also returning -1 to signify that the request is unsupported.
I assume you'll remember to provide a CL.
I wonder how we are expected to iterate over shared libraries
on Darwin 9 (we no longer have access to this version of Darwin).
Thanks!
> diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
> index 252fe3e..ac0aaac 100644
> --- a/gdb/darwin-nat.c
> +++ b/gdb/darwin-nat.c
> @@ -1821,6 +1821,10 @@ out:
> static int
> darwin_read_dyld_info (task_t task, CORE_ADDR addr, char *rdaddr, int length)
> {
> +#ifndef TASK_DYLD_INFO_COUNT
> + /* This is not available in Darwin 9. */
> + return -1;
> +#else
> struct task_dyld_info task_dyld_info;
> mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT;
> int sz = TASK_DYLD_INFO_COUNT * sizeof (natural_t);
> @@ -1838,6 +1842,7 @@ darwin_read_dyld_info (task_t task, CORE_ADDR addr, char
> *rdaddr, int length)
> length = sz - addr;
> memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
> return length;
> +#endif
> }
>
>
> -mike
--
Joel