* [PATCH] TASK_DYLD_INFO_COUNT build fix for darwin9
@ 2013-01-02 18:39 Fabian Groffen
2013-01-02 19:35 ` Tristan Gingold
0 siblings, 1 reply; 4+ messages in thread
From: Fabian Groffen @ 2013-01-02 18:39 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]
This is a resent of patch 3/ from:
http://sourceware.org/ml/gdb-patches/2011-12/msg00890.html
Modified for 7.5.1 sources, as this is still a problem, see:
http://sourceware.org/bugzilla/show_bug.cgi?id=14405
From: Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
To: gdb-patches at sourceware dot org
Date: Thu, 29 Dec 2011 20:30:31 +0000
Subject: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10.
gdb:
* darwin-nat.c (darwin_read_dyld_info): Only build if
TASK_DYLD_INFO_COUNT is available.
(darwin_xfer_partial): Don not try to fetch dyld info
unless TASK_DYLD_INFO_COUNT is available.
====
TASK_DYLD_INFO_COUNT etc. are not defined.
Fixed thus:
--- gdb/darwin-nat.c
+++ gdb/darwin-nat.c
@@ -1814,6 +1814,7 @@
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. */
@@ -1839,6 +1840,7 @@
memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
return length;
}
+#endif
\f
/* Return 0 on failure, number of bytes handled otherwise. TARGET
@@ -1881,6 +1883,7 @@
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)
{
@@ -1888,6 +1891,7 @@
return -1;
}
return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
+#endif
default:
return -1;
}
--
Fabian Groffen
Gentoo on a different level
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] TASK_DYLD_INFO_COUNT build fix for darwin9
2013-01-02 18:39 [PATCH] TASK_DYLD_INFO_COUNT build fix for darwin9 Fabian Groffen
@ 2013-01-02 19:35 ` Tristan Gingold
2013-01-02 21:05 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Tristan Gingold @ 2013-01-02 19:35 UTC (permalink / raw)
To: Fabian Groffen; +Cc: gdb-patches
On Jan 2, 2013, at 7:38 PM, Fabian Groffen wrote:
> This is a resent of patch 3/ from:
> http://sourceware.org/ml/gdb-patches/2011-12/msg00890.html
>
> Modified for 7.5.1 sources, as this is still a problem, see:
> http://sourceware.org/bugzilla/show_bug.cgi?id=14405
>
> From: Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
> To: gdb-patches at sourceware dot org
> Date: Thu, 29 Dec 2011 20:30:31 +0000
> Subject: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10.
>
> gdb:
>
> * darwin-nat.c (darwin_read_dyld_info): Only build if
> TASK_DYLD_INFO_COUNT is available.
> (darwin_xfer_partial): Don not try to fetch dyld info
> unless TASK_DYLD_INFO_COUNT is available.
Ok.
>
> ====
>
> TASK_DYLD_INFO_COUNT etc. are not defined.
>
> Fixed thus:
> --- gdb/darwin-nat.c
> +++ gdb/darwin-nat.c
> @@ -1814,6 +1814,7 @@
> 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. */
> @@ -1839,6 +1840,7 @@
> memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
> return length;
> }
> +#endif
>
>
> /* Return 0 on failure, number of bytes handled otherwise. TARGET
> @@ -1881,6 +1883,7 @@
> 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)
> {
> @@ -1888,6 +1891,7 @@
> return -1;
> }
> return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
> +#endif
> default:
> return -1;
> }
>
>
> --
> Fabian Groffen
> Gentoo on a different level
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] TASK_DYLD_INFO_COUNT build fix for darwin9
2013-01-02 19:35 ` Tristan Gingold
@ 2013-01-02 21:05 ` Mike Frysinger
2013-01-07 11:21 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2013-01-02 21:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Tristan Gingold, Fabian Groffen
[-- Attachment #1: Type: Text/Plain, Size: 2520 bytes --]
On Wednesday 02 January 2013 14:35:09 Tristan Gingold wrote:
> On Jan 2, 2013, at 7:38 PM, Fabian Groffen wrote:
> > This is a resent of patch 3/ from:
> > http://sourceware.org/ml/gdb-patches/2011-12/msg00890.html
> >
> > Modified for 7.5.1 sources, as this is still a problem, see:
> > http://sourceware.org/bugzilla/show_bug.cgi?id=14405
> >
> > From: Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
> > To: gdb-patches at sourceware dot org
> > Date: Thu, 29 Dec 2011 20:30:31 +0000
> > Subject: [Patch Darwin] head build fixes for
> > i686-darwin9/x86_64-darwin10.
> >
> > gdb:
> > * darwin-nat.c (darwin_read_dyld_info): Only build if
> > TASK_DYLD_INFO_COUNT is available.
> > (darwin_xfer_partial): Don not try to fetch dyld info
> > unless TASK_DYLD_INFO_COUNT is available.
>
> Ok.
i've committed this slightly tweaked version
-mike
2013-01-02 Iain Sandoe <developer@sandoe-acoustics.co.uk>
* darwin-nat.c (darwin_read_dyld_info): Only build if
TASK_DYLD_INFO_COUNT is defined.
(darwin_xfer_partial): Call darwin_read_dyld_info only if
TASK_DYLD_INFO_COUNT is defined.
--- darwin-nat.c 1 Jan 2013 06:32:41 -0000 1.39
+++ darwin-nat.c 2 Jan 2013 21:04:56 -0000
@@ -1816,8 +1816,10 @@ out:
/* 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. */
+#ifndef 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)
{
@@ -1839,6 +1841,7 @@ darwin_read_dyld_info (task_t task, CORE
memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
return length;
}
+#endif
\f
/* Return 0 on failure, number of bytes handled otherwise. TARGET
@@ -1881,6 +1884,7 @@ darwin_xfer_partial (struct target_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)
{
@@ -1888,6 +1892,7 @@ darwin_xfer_partial (struct target_ops *
return -1;
}
return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
+#endif
default:
return -1;
}
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] TASK_DYLD_INFO_COUNT build fix for darwin9
2013-01-02 21:05 ` Mike Frysinger
@ 2013-01-07 11:21 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2013-01-07 11:21 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, Tristan Gingold, Fabian Groffen
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
> i've committed this slightly tweaked version
Unfortunately, it looks like you accidently changed an "#ifdef"
into a "#ifndef". The build is failing for me. Fixed thusly.
gdb/ChangeLog:
* darwin-nat.c: Fix typo in TASK_DYLD_INFO_COUNT macro test
used to decide whether to define darwin_read_dyld_info or not.
You'll might want to ask your collegue/friend to rebuild to make sure
it works. I suspect it wouldn't have worked before my patch for him
either.
Cheers,
--
Joel
[-- Attachment #2: 0001-Fix-build-failure-on-darwin-due-to-darwin_read_dyld_.patch --]
[-- Type: text/x-diff, Size: 1395 bytes --]
From 4682b679f3da36234b47a410b057f465434078d2 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Mon, 7 Jan 2013 06:00:29 -0500
Subject: [PATCH] Fix build failure on darwin due to darwin_read_dyld_info not
being defined.
gdb/ChangeLog:
* darwin-nat.c: Fix typo in TASK_DYLD_INFO_COUNT macro test
used to decide whether to define darwin_read_dyld_info or not.
---
gdb/ChangeLog | 5 +++++
gdb/darwin-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ac806e9..69b71f5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-07 Joel Brobecker <brobecker@adacore.com>
+
+ * darwin-nat.c: Fix typo in TASK_DYLD_INFO_COUNT macro test
+ used to decide whether to define darwin_read_dyld_info or not.
+
2013-01-03 Pierre Muller <muller@sourceware.org>
* main.c (relocate_gdb_directory): Avoid calling stat function
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 0307048..1344101 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1818,7 +1818,7 @@ out:
to RDADDR.
Return 0 on failure; number of bytes read / written otherwise. */
-#ifndef TASK_DYLD_INFO_COUNT
+#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)
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-07 11:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-02 18:39 [PATCH] TASK_DYLD_INFO_COUNT build fix for darwin9 Fabian Groffen
2013-01-02 19:35 ` Tristan Gingold
2013-01-02 21:05 ` Mike Frysinger
2013-01-07 11:21 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox