Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#579834: Patch to enable a fully working gdb for GNU/Hurd

23 views
Skip to first unread message

Tom Tromey

unread,
Jul 5, 2011, 12:20:01 PM7/5/11
to
>>>>> "Svante" == Svante Signell <svante....@telia.com> writes:

Svante> 2) When debugging an executable gdb does not find the debugging symbols
Svante> for libraries. For example with libc0.3-dbg installed, the symbols are
Svante> found with 7.2 but not with 7.3.50 when running the built gdb directly
Svante> on an executable having debugging symbols (they are found).

If libc0.3-dbg is just the separate debuginfo package, then make sure
you have configured gdb with the correct --with-separate-debug-dir.

Tom

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Thomas Schwinge

unread,
Jul 5, 2011, 11:00:03 AM7/5/11
to
Hallo!

On Tue, 05 Jul 2011 16:38:04 +0200, Svante Signell <svante....@telia.com> wrote:
> On Mon, 2011-07-04 at 21:17 +0200, Svante Signell wrote:
> > On Mon, 2011-07-04 at 20:18 +0200, Thomas Schwinge wrote:
> > > I think that update_thread_list (which already is exported) should rather
> > > be invoked instead of additionally exporting prune_threads.
> > >
> > > But -- I can no longer reproduce the original problem with GDB HEAD. Can
> > > you?
> >
> > I haven't compiled gdb for some time now. I can take a look, how to get
> > the GDB HEAD? The prune_threads enabled gdb to work properly, and then
> > Samuel applied an earlier version of the patch on debian-ports.
> >
> > Since then the new Debian gdb maintainer wanted to get this patch
> > applied upstream, so I did as was requested. Don't know if it is the
> > correct approach or not. I can try to use update_thread_list instead,
> > once I have the GDB HEAD files.
>
> I have now built gdb HEAD and found that the patch is no longer needed.

OK, and thanks for confirming! Thus, I'll close the GDB PR.


> Additionally adding update_thread_list in gnu_nat.c works for gdb-7.2,
> will propose the following patch to the Debian bug report #579834 in
> case there will be more releases of the 7.2-series until 7.4 is
> released.

Either that, or simply continue to use the patch we're currently using
(no additional work for the Debian maintainers). The existing patch
doesn't do any harm, and can then simply be dropped once Debian is
switching to a GDB release that no longer requires the patch -- which is
still to be determined.


> A few observations when building gdb HEAD: GNU gdb (GDB)
> 7.3.50.20110704-cvs though:
>
> 1) I had to uncomment -Werror when compiling gdb/msg_U.c with Debian
> 4.6.1-1+hurd.1 due to the -Wstrict-aliasing flag set by -Wall, see
> below:
>
> msg_U.c: In function 'msg_del_auth':
> msg_U.c:505:3: error: dereferencing type-punned pointer will break
> strict-aliasing rules [-Werror=strict-aliasing]

This issue is known: search for ``werror'' on
<http://www.bddebian.com/~hurd-web/open_issues/gdb/>.


> 2) When debugging an executable gdb does not find the debugging symbols

> for libraries. For example with libc0.3-dbg installed, the symbols are

> found with 7.2 but not with 7.3.50 when running the built gdb directly

> on an executable having debugging symbols (they are found).

I would guess this is not Hurd-specific, but is due to Debian's multiarch
changes, and is thus a general problem.


Grüße,
Thomas

Svante Signell

unread,
Jul 5, 2011, 10:50:03 AM7/5/11
to
On Mon, 2011-07-04 at 21:17 +0200, Svante Signell wrote:
> On Mon, 2011-07-04 at 20:18 +0200, Thomas Schwinge wrote:
> > Hallo!
...

> > I think that update_thread_list (which already is exported) should rather
> > be invoked instead of additionally exporting prune_threads.
> >
> > But -- I can no longer reproduce the original problem with GDB HEAD. Can
> > you?
>
> I haven't compiled gdb for some time now. I can take a look, how to get
> the GDB HEAD? The prune_threads enabled gdb to work properly, and then
> Samuel applied an earlier version of the patch on debian-ports.
>
> Since then the new Debian gdb maintainer wanted to get this patch
> applied upstream, so I did as was requested. Don't know if it is the
> correct approach or not. I can try to use update_thread_list instead,
> once I have the GDB HEAD files.

I have now built gdb HEAD and found that the patch is no longer needed.

Additionally adding update_thread_list in gnu_nat.c works for gdb-7.2,
will propose the following patch to the Debian bug report #579834 in
case there will be more releases of the 7.2-series until 7.4 is
released.

--- gdb/gnu-nat.c.orig 2011-07-05 15:41:54.000000000 +0200
+++ gdb/gnu-nat.c 2011-07-05 14:27:31.000000000 +0200
@@ -1578,6 +1578,7 @@
if (--inf->pending_execs == 0)
/* We're done! */
{
+ update_thread_list();
#if 0 /* do we need this? */
prune_threads (1); /* Get rid of the old shell
threads */
renumber_threads (0); /* Give our threads reasonable
names. */

A few observations when building gdb HEAD: GNU gdb (GDB)
7.3.50.20110704-cvs though:

1) I had to uncomment -Werror when compiling gdb/msg_U.c with Debian
4.6.1-1+hurd.1 due to the -Wstrict-aliasing flag set by -Wall, see
below:

msg_U.c: In function 'msg_del_auth':
msg_U.c:505:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]

msg_U.c:520:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_get_init_ports':
msg_U.c:957:6: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_set_init_ports':
msg_U.c:1050:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_get_init_ints':
msg_U.c:1481:6: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_set_init_ints':
msg_U.c:1573:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_get_dtable':
msg_U.c:1739:6: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_set_dtable':
msg_U.c:1832:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_get_environment':
msg_U.c:2253:6: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_set_environment':
msg_U.c:2345:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_get_env_variable':
msg_U.c:2511:6: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c: In function 'msg_describe_ports':
msg_U.c:3018:3: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
msg_U.c:3083:6: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
cc1: all warnings being treated as errors

2) When debugging an executable gdb does not find the debugging symbols
for libraries. For example with libc0.3-dbg installed, the symbols are
found with 7.2 but not with 7.3.50 when running the built gdb directly
on an executable having debugging symbols (they are found).

--

Hector Oron

unread,
Jul 5, 2011, 7:10:02 PM7/5/11
to
Hello,

2011/7/5 Svante Signell <svante....@telia.com>:


> On Mon, 2011-07-04 at 21:17 +0200, Svante Signell wrote:
>> On Mon, 2011-07-04 at 20:18 +0200, Thomas Schwinge wrote:

> I have now built gdb HEAD and found that the patch is no longer needed.

Great! Does GDB from experimental work for you then?

> Additionally adding update_thread_list in gnu_nat.c works for gdb-7.2,
> will propose the following patch to the Debian bug report #579834 in
> case there will be more releases of the 7.2-series until 7.4 is
> released.

I plan to do more Debian releases for 7.2-series (7.3-series are
already in experimental, I would like to release there often), even
considering to provide a squeeze backport. I'll include the patch
below if you don't state the contrary.

> --- gdb/gnu-nat.c.orig  2011-07-05 15:41:54.000000000 +0200
> +++ gdb/gnu-nat.c       2011-07-05 14:27:31.000000000 +020
0
> @@ -1578,6 +1578,7 @@
>          if (--inf->pending_execs == 0)
>            /* We're done!  */
>            {
> +             update_thread_list();
>  #if 0                          /* do we need this? */
>              prune_threads (1);        /* Get rid of the old shell
> threads */
>              renumber_threads (0);     /* Give our threads reasonable
> names. */

Best regards,
--
 Héctor Orón  -.. . -... .. .- -.   -.. . ...- . .-.. --- .--. . .-.

<free spam>
-- Would you like to make a donation for Debian Conference?
   ** http://debconf11.debconf.org/payments.xhtml **
</free spam>

Svante Signell

unread,
Jul 5, 2011, 1:50:04 PM7/5/11
to
On Tue, 2011-07-05 at 10:15 -0600, Tom Tromey wrote:
> >>>>> "Svante" == Svante Signell <svante....@telia.com> writes:
>
> Svante> 2) When debugging an executable gdb does not find the debugging symbols
> Svante> for libraries. For example with libc0.3-dbg installed, the symbols are
> Svante> found with 7.2 but not with 7.3.50 when running the built gdb directly
> Svante> on an executable having debugging symbols (they are found).
>
> If libc0.3-dbg is just the separate debuginfo package, then make sure
> you have configured gdb with the correct --with-separate-debug-dir.

Looks like the following are set in the Debian case:
#define DEBUGDIR "/usr/lib/debug"
#define DEBUGDIR_RELOCATABLE 1

The difference with my build was that only --prefix=/usr was set
resulting in

#define DEBUGDIR "/usr/local/lib/debug"

Thanks, problem solved!

Svante Signell

unread,
Jul 6, 2011, 8:20:01 AM7/6/11
to
On Wed, 2011-07-06 at 01:03 +0200, Hector Oron wrote:
> Hello,
>
> 2011/7/5 Svante Signell <svante....@telia.com>:
> > On Mon, 2011-07-04 at 21:17 +0200, Svante Signell wrote:
> >> On Mon, 2011-07-04 at 20:18 +0200, Thomas Schwinge wrote:
>
> > I have now built gdb HEAD and found that the patch is no longer needed.
>
> Great! Does GDB from experimental work for you then?

Adding to sources.list:

deb-src http://ftp.se.debian.org/debian/ experimental main contrib
non-free

I expected to be able to get the sources, with

apt-get source -t experimental gdb

but I get an error instead:
E: Ignore unavailable target release 'experimental' of package 'gdb'
E: Unable to find a source package for

The package is found in:
/var/lib/apt/lists/ftp.se.debian.org_debian_dists_experimental_main_source_Sources

Whats up? Do I have to download manually? Of course experimental not
part of any release.

When I have the source for 7.3.50~cvs20110627-1 I'll compile and try if
it works w/o the patch. The one I compiled was 7.3.50.20110704-cvs so
they are very close in date.

> I plan to do more Debian releases for 7.2-series (7.3-series are
> already in experimental, I would like to release there often), even
> considering to provide a squeeze backport. I'll include the patch
> below if you don't state the contrary.

Confirmed that it works for the 7.2 series.

Hector Oron

unread,
Jul 6, 2011, 9:00:02 AM7/6/11
to
Hi,

2011/7/6 Svante Signell <svante....@telia.com>:

> Adding to sources.list:
>
> deb-src http://ftp.se.debian.org/debian/ experimental main contrib
> non-free
>
> I expected to be able to get the sources, with
>
> apt-get source -t experimental gdb
>
> but I get an error instead:
> E: Ignore unavailable target release 'experimental' of package 'gdb'
> E: Unable to find a source package for

Did you miss apt-get update?

> Whats up? Do I have to download manually? Of course experimental not
> part of any release.

Should be on the archive as any other package
< http://packages.debian.org/experimental/gdb >

> When I have the source for 7.3.50~cvs20110627-1 I'll compile and try if
> it works w/o the patch. The one I compiled was 7.3.50.20110704-cvs so
> they are very close in date.

You should not need to compile it, just apt-get install
gdb/experimental with appropriate sources.list.

Best regards,
--
 Héctor Orón  -.. . -... .. .- -.   -.. . ...- . .-.. --- .--. . .-.

<free spam>
-- Would you like to make a donation for Debian Conference?
   ** http://debconf11.debconf.org/payments.xhtml **
</free spam>

--

Svante Signell

unread,
Jul 6, 2011, 9:40:02 AM7/6/11
to
On Wed, 2011-07-06 at 12:50 +0000, Hector Oron wrote:
> Hi,
>
> 2011/7/6 Svante Signell <svante....@telia.com>:
>
> > Adding to sources.list:
> >
> > deb-src http://ftp.se.debian.org/debian/ experimental main contrib
> > non-free
> >
> > I expected to be able to get the sources, with
> >
> > apt-get source -t experimental gdb
> >
> > but I get an error instead:
> > E: Ignore unavailable target release 'experimental' of package 'gdb'
> > E: Unable to find a source package for
>
> Did you miss apt-get update?

For Linux yes, for Hurd no.

> > Whats up? Do I have to download manually? Of course experimental not
> > part of any release.
>
> Should be on the archive as any other package
> < http://packages.debian.org/experimental/gdb >

Yes, they are there, but why does not apt-get source work in Hurd, it
does in Linux?

> > When I have the source for 7.3.50~cvs20110627-1 I'll compile and try if
> > it works w/o the patch. The one I compiled was 7.3.50.20110704-cvs so
> > they are very close in date.
>
> You should not need to compile it, just apt-get install
> gdb/experimental with appropriate sources.list.

It's not yet compiled for GNU/Hurd, in think it has not yet been enabled
to the buildds. I has to be tweaked somewhat, like disabling -Werror for
compilation (of file msg_U.c). I will request that when I have confirmed
that it compiled and works OK for me.

Svante Signell

unread,
Jul 6, 2011, 5:30:02 PM7/6/11
to
On Wed, 2011-07-06 at 15:37 +0200, Svante Signell wrote:
> On Wed, 2011-07-06 at 12:50 +0000, Hector Oron wrote:

> Yes, they are there, but why does not apt-get source work in Hurd, it
> does in Linux?

Found the problem, different versions of apt and two versions in the source repository:
7.3.50~cvs20110627-1 and 7.3.50~cvs20110627-2

> > > When I have the source for 7.3.50~cvs20110627-1 I'll compile and try if
> > > it works w/o the patch. The one I compiled was 7.3.50.20110704-cvs so
> > > they are very close in date.
> >
> > You should not need to compile it, just apt-get install
> > gdb/experimental with appropriate sources.list.

See below.

> It's not yet compiled for GNU/Hurd, in think it has not yet been enabled
> to the buildds. I has to be tweaked somewhat, like disabling -Werror for
> compilation (of file msg_U.c). I will request that when I have confirmed
> that it compiled and works OK for me.

Recently built by the buildd, but not yet available. From my own build I
can now confirm that 7.3.50~cvs20110627-2 works without the 7.2 patch.
You can close this bug whenever an updated 7.2 version is built or a cvs
version reaches unstable (or 7.4 is released).

0 new messages