tdep/2109: gdb 6.4 and 6.4.50 can't debug x86_64 binaries on Solaris 2.10
>Synopsis: gdb 6.4 and 6.4.50 can't debug x86_64 binaries on Solaris 2.10
>Arrival-Date: Wed Apr 05 02:58:01 GMT 2006
>Originator: [hidden email] >Release: 6.4 and 6.4.50 (CVS snapshot)
Sun Solaris 2.10 on a dual AMD Sun W2100z workstation. config.guess identifies it as i386-pc-solaris2.10. Built as a 64 bit executable (ELF64) with Sun's (no-cost) Studio 11 development environment.
I built gdb 6.4 and 6.4.50 with Sun Studio 11's C compiler (it's no-cost, these days). I used CFLAGS=
-Xa -xs -g -xtarget=native -xarch=amd64
build went fine, and produced a 64 bit gdb:
gdb: ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE FXSR FPU], dynamically linked, not stripped
gdb can't debug ELF64 executables, though:
GNU gdb 184.108.40.20660402
Copyright (C) 2006 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 "i386-pc-solaris2.10"..."/local/gnu/bin/gdb": not in executable format: File format not recognized
I did some reading to see if I needed to do something special (like a "cross-compile", since configure defaulted to host=i386-pc-solaris2.10), but the bfd/config.bfd seems to indicate that any i[3-7]86-*-solaris2* should have bfd_elf64_x86_64_vec support, and "want64=true". I'm assuming that means that gdb *should* by default support ELF64 executables.
BTW, this exact problem was reported by NAKAJI Hiroyuki in gnu.gdb.bug in December of 2005:
There was no response to Nakaji's report.
Install Solaris 10 (downloadable at no cost) on a 64-bit capable AMD box.
Install Sun Studio 11 (downloadable at no cost).
Configure and build gdb 6.4 or gdb-6.4+CVS using Studio 11, as a 64-bit executable. The resulting gdb cannot debug 64 bit executables.
Note: I'm not saying this problem is specific to gdb when built with Studio 11 (as opposed to gcc) or as a 32 bit executable. I haven't tried either of those cases, since I'm highly skeptical that they're relevant. I will try them if you believe they are.