This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Sunday 23 December 2012 23:26:57 Joel Brobecker wrote:
> > 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.

hmm, actually, that change won't work :/.  it doesn't handle 
TARGET_OBJECT_DARWIN_DYLD_INFO not being defined.

so back to the original patch:
--- 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;
      }

> I wonder how we are expected to iterate over shared libraries
> on Darwin 9 (we no longer have access to this version of Darwin).

i don't run any Darwin/OS X version, so i don't know.  i just implemented this 
for a fellow Gentoo dev.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]