I am using debian squeeze.
2.6.32-5-vserver-amd64 #1 SMP Sat Jul 24 03:17:33 UTC 2010 x86_64 GNU/Linux
It seems my gdb is configured for i686 and not x64.
I can't create any executables with g++ that gdb is able to debug.
$ file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
$ gdb a.out
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-linux-gnu"...
"a.out": not in executable format: File format not recognized
(gdb)
I googled and found this:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425838
It looks like a binutils incompatibility came up back in 2007 with lenny. Is it something similar?