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
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.
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... :)
can you do a rpm -q of binutils and glibc?
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".
Yes my tools are recent enough to use the new ppc64 ABI. Will try downgrading in the morning.
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)
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
Andrew has a workaround in gdb now.
Nope, still present with .41. more debugging ...
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.
gdb-6.1post-1.20040607.42, if it ever makes it through beehive, sitting in fc3-HEAD should contain the fix.
Where is the gdb .42? I can't find it. Did the build complete?
The build was canned (along with an s390), there should be a .43 build in fc3-HEAD.
David, would you mind retesting with the latest gdb and let us know if it suits your needs? Thanks!
Seems OK now, and we do actually have the ppc64 gdb in the compose.
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