Bug 518712 - gdb thinks sizeof(long)==4 on 64bit
Summary: gdb thinks sizeof(long)==4 on 64bit
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 11
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-21 19:22 UTC by Stas Sergeev
Modified: 2009-08-21 21:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-21 21:29:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Stas Sergeev 2009-08-21 19:22:37 UTC
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.

Comment 1 Jan Kratochvil 2009-08-21 21:29:00 UTC
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


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