Bug 135410 - Cannot debug 64-bit userspace.
Cannot debug 64-bit userspace.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
rawhide
powerpc Linux
medium Severity medium
: ---
: ---
Assigned To: Andrew Cagney
:
Depends On:
Blocks: FC3Target 135876
  Show dependency treegraph
 
Reported: 2004-10-12 11:46 EDT by David Woodhouse
Modified: 2007-11-30 17:10 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-29 10:30:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description David Woodhouse 2004-10-12 11:46:25 EDT
Description of problem:
Debugging 64-bit userspace programs fails. With the shipped 32-bit gdb
package, we can't even load 64-bit executables. With the 64-bit gdb
which we don't actually ship, I get this...

Script started on Tue 12 Oct 2004 15:46:42 BST
fish /home/dwmw2 $ cat helloworld.c
#include <stdio.h>
 
int main(void)
{
        printf("Hello world\n");
        return 0;
}
 
fish /home/dwmw2 $ gcc -g -m64 helloworld.c
fish /home/dwmw2 $ rpm -q --qf
%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\\n gdb
gdb-6.1post-1.20040607.38.ppc64
fish /home/dwmw2 $ gdb a.out
GNU gdb Red Hat Linux (6.1post-1.20040607.38rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "ppc64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
 
(gdb) break main
Breakpoint 1 at 0x10000534: file helloworld.c, line 5.
(gdb) run
Starting program: /home/dwmw2/a.out
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: Breakpoint address adjusted from 0x10010960 to 0x100003b8.
 
Breakpoint 1, 0x0000000010000534 in ?? ()
(gdb) q
The program is running.  Exit anyway? (y or n) y
fish /home/dwmw2 $ gcc -g -m32 helloworld.c
fish /home/dwmw2 $ gdb a.out
GNU gdb Red Hat Linux (6.1post-1.20040607.38rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "ppc64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
 
(gdb) break main
Breakpoint 1 at 0x1000042c: file helloworld.c, line 5.
(gdb) run
Starting program: /home/dwmw2/a.out
 
Breakpoint 1, main () at helloworld.c:5
5               printf("Hello world\n");
(gdb) q
The program is running.  Exit anyway? (y or n) y
fish /home/dwmw2 $ exit
 
Script done on Tue 12 Oct 2004 16:45:43 BST
Comment 1 Bill Nottingham 2004-10-12 12:37:48 EDT
AFAIK, if you install from the ppc64 tree, you get 64-bit gdb. If you
install from the ppc32 tree, you get 32-bit gdb.
Comment 2 David Woodhouse 2004-10-12 12:44:40 EDT
This was the 64-bit gdb. 

However, the ppc32 install tree is biarch and does contain most
packages you need for 64-bit operation -- the kernel, all libraries
etc. It's just that it doesn't include a 64-bit gdb.

Not that this is much of a loss while the 64-bit gdb doesn't actually
_work_, mind you... :)
Comment 3 Elena Zannoni 2004-10-13 14:41:23 EDT
can you do a rpm -q of binutils and glibc?
Comment 4 Andrew Cagney 2004-10-13 14:48:07 EDT
How recent is your binutils (and GCC) - can you down grade a little? 
There's a ABI change looming that strips the executable of half the
symbols that may cause this.  Does the executable contain both "main"
and ".main", or just "main".
Comment 5 David Woodhouse 2004-10-13 16:20:12 EDT
Yes my tools are recent enough to use the new ppc64 ABI. Will try
downgrading in the morning.
Comment 6 David Woodhouse 2004-10-14 02:11:53 EDT
Using the old ABI does make GDB happy again...

fish /home/dwmw2 $ gcc -g -m64 -mcall-aixdesc helloworld.c
fish /home/dwmw2 $ gdb a.out
GNU gdb Red Hat Linux (6.0post-0.20040223.19rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "ppc64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
 
(gdb) break main
Breakpoint 1 at 0x10000534: file helloworld.c, line 5.
(gdb) run
Starting program: /home/dwmw2/a.out
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: Breakpoint address adjusted from 0x10010960 to 0x100003b8.
 
Breakpoint 1, main () at helloworld.c:5
5               printf("Hello world\n");
(gdb)
Comment 7 David Woodhouse 2004-10-14 02:17:08 EDT
Sorry, Elena: 
fish /home/dwmw2 $ rpm -q --qf
%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\\n glibc binutils
glibc-2.3.3-66.ppc
glibc-2.3.3-66.ppc64
binutils-2.15.92.0.2-2.ppc
Comment 12 Elena Zannoni 2004-10-20 14:49:55 EDT
Andrew has a workaround in gdb now.
Comment 13 Andrew Cagney 2004-10-21 15:47:30 EDT
Nope, still present with .41. more debugging ...
Comment 14 Andrew Cagney 2004-10-21 18:01:15 EDT
Try fish:~cagney/PENDING/devel/64/gdb/gdb

On 64-bit PPC, the _dl_debug_state symbol is in the data section,
tweaking solib-svr4.c to search all sections for the symbol gets
around the problem.  Need to figure out why it's in the data section.
Comment 15 Andrew Cagney 2004-10-22 16:54:51 EDT
gdb-6.1post-1.20040607.42, if it ever makes it through beehive,
sitting in fc3-HEAD should contain the fix.
Comment 16 Elena Zannoni 2004-10-26 10:48:31 EDT
Where is the gdb .42? I can't find it. Did the build complete?
Comment 17 Andrew Cagney 2004-10-27 00:56:58 EDT
The build was canned (along with an s390), there should be a .43 build
in fc3-HEAD.
Comment 19 Jay Turner 2004-11-12 05:14:56 EST
David, would you mind retesting with the latest gdb and let us know if it suits
your needs?  Thanks!
Comment 20 David Woodhouse 2004-11-29 10:30:18 EST
Seems OK now, and we do actually have the ppc64 gdb in the compose.
Comment 21 John Flanagan 2004-12-21 14:37:20 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-561.html

Note You need to log in before you can comment on or make changes to this bug.