This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug corefiles/22795] Variables in the .bss section are printed as 32-bit
- From: "simon.marchi at ericsson dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 06 Feb 2018 14:27:10 +0000
- Subject: [Bug corefiles/22795] Variables in the .bss section are printed as 32-bit
- Auto-submitted: auto-generated
- References: <bug-22795-4717@http.sourceware.org/bugzilla/>
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.