This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug corefiles/22795] Variables in the .bss section are printed as 32-bit


https://sourceware.org/bugzilla/show_bug.cgi?id=22795

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at ericsson dot com

--- Comment #1 from Simon Marchi <simon.marchi at ericsson dot com> ---
This is probably because you don't have debug info for this code.  Until 8.0,
GDB would assume that data symbols without a known type were of type int, so it
would print a truncated value when the variable was actually of a longer type. 
With the following program:

long long allo = -1152921504606846953;
int main()
{
}

GDB 8.1 will print:

(gdb) p allo
'allo' has unknown type; cast it to its declared type

Which forces you to cast it to the right type:

(gdb) p (long long) allo
$1 = -1152921504606846953

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]