Re: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10.

Joel Brobecker
2012-12-24T04:27:15Z

> 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
> }
>
> \f
> -mike

--
Joel