Bug 12222 - gdb broken on GNU/Hurd since 7.1
Summary: gdb broken on GNU/Hurd since 7.1
Status: RESOLVED WORKSFORME
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.1
: P2 normal
Target Milestone: ---
Assignee: Thomas Schwinge
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 14:34 UTC by Samuel Thibault
Modified: 2011-07-05 15:03 UTC (History)
4 users (show)

See Also:
Host: i386-unknown-gnu0.3
Target:
Build:
Last reconfirmed:


Attachments
Updated patch for gdb-7.2 on GNU/Hurd (666 bytes, patch)
2011-05-17 17:04 UTC, Svante Signell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Thibault 2010-11-16 14:34:50 UTC
Hello,

gdb is not usable on GNU/Hurd since 7.1 (7.0 is working fine). For instance, running with version 7.2:

$ gdb ./test
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/data/home/youpi/test...(no debugging symbols found)...done.
(gdb) r
Starting program: /media/data/home/youpi/test 
Can't fetch registers from thread bogus thread id 1: No such thread

while with gdb 7.0:

$ gdb ./test
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/data/home/youpi/test...done.
(gdb) r
Starting program: /media/data/home/youpi/test 
[New Thread 26750.5]

Program received signal SIGSEGV, Segmentation fault.
0x0804846c in main () at test.c:2
2               *(int*)0 = 0;

(test is just an int main(void){ *(int*)0=0; } program compiled with just -g)
Comment 1 Thomas Schwinge 2010-11-16 16:29:02 UTC
Also reported here: <http://bugs.debian.org/579834>, and I had tracked it
at <http://www.gnu.org/software/hurd/open_issues/gdb_head.html>.

A year ago, I posted a patch that worked for me,
<http://sourceware.org/ml/gdb-patches/2009-11/msg00581.html>, but I
didn't bring this issue to an end.  Still planning on getting back to
this sometime.  If you want, please review / test the patch.
Comment 2 Alfred M. Szmidt 2010-11-18 20:08:28 UTC
Thanks, looking into it.  Please file bugs regarding gdb and the hurd to this bugzilla in the future.
Comment 3 Samuel Thibault 2011-03-22 10:00:34 UTC
Note that a patch was checked as working by Thomas on
http://sourceware.org/ml/gdb-patches/2009-11/msg00581.html
but without answer.
Comment 4 Alfred M. Szmidt 2011-04-01 21:36:47 UTC
   Note that a patch was checked as working by Thomas on
   http://sourceware.org/ml/gdb-patches/2009-11/msg00581.html
   but without answer.

I couldn't compile GDB on GNU/Hurd to test this patch (kernel panics
all over the places as soon as I start linking anything large like
gdb) or get a cross compiler working on my system, if you can test it
and check Pedros concerns then that would be great.
Comment 5 Samuel Thibault 2011-04-02 19:54:30 UTC
I have uploaded a debian package on debian-ports, and our testers have
confirmed that everything seems to be working fine.
Comment 6 Svante Signell 2011-05-17 17:04:31 UTC
Created attachment 5731 [details]
Updated patch for gdb-7.2 on GNU/Hurd

Attached is an updated patch for gdb-7.2, to make gdb fully functional on GNU/Hurd. The previously attached patch did not include the change from static to non-static to make the prune() function available outside the scope of gnu-nat.c
Comment 7 Tom Tromey 2011-05-17 17:10:21 UTC
Please follow the contribution instructions here:

http://sourceware.org/gdb/contribute/
Comment 8 Svante Signell 2011-06-28 20:57:52 UTC
(In reply to comment #7)
> Please follow the contribution instructions here:
> 
> http://sourceware.org/gdb/contribute/

What is missing from the comment and the patch? A problem description? And then send to gdb-pacthes@sourceware.org? Regarding coypright assignment this patch would be classified as a small change, right?
Comment 9 Tom Tromey 2011-06-29 13:47:00 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Please follow the contribution instructions here:
> > 
> > http://sourceware.org/gdb/contribute/
> 
> What is missing from the comment and the patch? A problem description? And then
> send to gdb-pacthes@sourceware.org? Regarding coypright assignment this patch
> would be classified as a small change, right?

The patch is also missing a ChangeLog entry.
Yes, I think it would be called a small change.
Comment 10 Alfred M. Szmidt 2011-06-30 23:17:00 UTC
   What is missing from the comment and the patch? A problem description? 

I'd like to see a problem description, all I have seen is "this fixes
it" but no clear reasoning why it fixes.

   And then send to gdb-pacthes@sourceware.org?

Yes please, I'm going on a 5 week vacation so if someone can commit it
if you think it is good enough then that would be great.

   Regarding coypright assignment this patch would be classified as a
   small change, right?

As Tromney noted, this is a tiny change.
Comment 11 Svante Signell 2011-07-04 08:16:28 UTC
(In reply to comment #10)
>    What is missing from the comment and the patch? A problem description? 
> 
> I'd like to see a problem description, all I have seen is "this fixes
> it" but no clear reasoning why it fixes.
> 
>    And then send to gdb-patches@sourceware.org?
> 
> Yes please, I'm going on a 5 week vacation so if someone can commit it
> if you think it is good enough then that would be great.

Aore informative description and the patch has now been sent to gdb-patches, see
http://sourceware.org/ml/gdb-patches/2011-06/msg00458.html

Please let me know if there is still something missing?
Comment 12 Thomas Schwinge 2011-07-05 15:03:42 UTC
As per <http://sourceware.org/ml/gdb-patches/2011-07/msg00104.html> and
confirmed in <http://sourceware.org/ml/gdb-patches/2011-07/msg00146.html>
this patch is no longer needed with GDB HEAD; thus closing.