Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Cc: Tristan Gingold <gingold@adacore.com>,
	Iain Sandoe <developer@sandoe-acoustics.co.uk>
Subject: Re: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10.
Date: Mon, 24 Dec 2012 03:57:00 -0000	[thread overview]
Message-ID: <201212232258.05972.vapier@gentoo.org> (raw)
In-Reply-To: <03DE2A59-DA13-4F7C-B757-533D4AF5F1DD@adacore.com>

[-- Attachment #1: Type: Text/Plain, Size: 2514 bytes --]

On Monday 02 January 2012 09:38:57 Tristan Gingold wrote:
> On Dec 29, 2011, at 9:30 PM, Iain Sandoe wrote:
> > =====
> > 
> > 3/ (Darwin 9 only)
> > TASK_DYLD_INFO_COUNT etc. are not defined.
> > 
> > Fixed thus:
> > diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
> > index 94f49d6..efc59e7 100644
> > --- a/gdb/darwin-nat.c
> > +++ b/gdb/darwin-nat.c
> > @@ -1823,6 +1823,7 @@ out:
> >   return length;
> > }
> > 
> > +#ifdef TASK_DYLD_INFO_COUNT
> > /* 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.  */
> > @@ -1848,7 +1849,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
> >    is ignored.  */
> > @@ -1890,6 +1891,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)
> >         {
> > @@ -1897,6 +1899,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;
> >     }
> 
> Ok (but a comment would be very welcome).

how about this instead.  it localizes the #ifdef and has a comment.

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-12-24  3:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 20:32 Iain Sandoe
2012-01-02 11:40 ` Pedro Alves
2012-01-02 14:39 ` Tristan Gingold
2012-12-24  3:57   ` Mike Frysinger [this message]
2012-12-24  4:27     ` Joel Brobecker
2012-12-24  5:09       ` Mike Frysinger
2012-12-24  3:56 ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201212232258.05972.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=developer@sandoe-acoustics.co.uk \
    --cc=gdb-patches@sourceware.org \
    --cc=gingold@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox