Description of problem: gdb thinks sizeof(long)==4 on x86_64, but (quite unfortunately) it is 8. Version-Release number of selected component (if applicable): gdb-6.8.50.20090302-37.fc11.x86_64 How reproducible: Always Steps to Reproduce: 1. gdb 2. p sizeof(long) Actual results: $1 = 4 Expected results: $1 = 8 Additional info: gcc-compiled program shows that sizeof(long)==8.
Fedora GDB is built in biarch mode to properly support both 32-bit and 64-bit programs. For some reason the default is 32-bit. I do not find such choice to be important enough to need a fix, please provide more reasons if you think so. $ gdb GNU gdb (GDB) Fedora (6.8.50.20090302-37.fc11) 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 "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. (gdb) p sizeof (long) $1 = 4 (gdb) show architecture The target architecture is set automatically (currently i386) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) p sizeof (long) $2 = 8 (gdb) q