This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/1870: Cannot display local variables with amd64
- From: ttomaich at ifltd dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 15 Feb 2005 19:57:31 -0000
- Subject: gdb/1870: Cannot display local variables with amd64
- Reply-to: ttomaich at ifltd dot com
>Number: 1870
>Category: gdb
>Synopsis: Cannot display local variables with amd64
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 15 19:58:00 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator: ttomaich@ifltd.com
>Release: 6.1post-1.20040607.52rh
>Organization:
>Environment:
Red Hat Linux ES 3.2, SUN v40z, AMD64 Opteron (x86_64), compiled with gcc 2.96.
>Description:
I cannot display the values of local variables when debuggin using gdb. I found the following fix on the web, and have tried to implement it myself. However, I was unable to rebuild gdb, and so I am stuck. I submitted that rebuild as a separate bug report.
This was found at
http://lists.gnu.org/archive/html/bug-gdb/2004-12/msg00005.html
and it describes one person's fix of the issue.
Dear Friends:
I reported recently a bug in gdb for amd64. It will not display any
local variables if you use the stabs debug info.
Fix:
This bug disappears if you change in the source code of gdb the
file "findvar.c" line 463 from
<buggy code>
addr += SYMBOL_VALUE(var);
</buggy code>
to
<fixed code>
addr += (signed int)SYMBOL_VALUE(var);
</fixed code>
Background:
The value stored in "var" is a negative offset from EBP. This
negative number gets converted to a huge positive number
because of the lack of sign extension when reading the stabs
debug info. Instead of a negative number we have a positive
number greater than 2Giga. When this address is added to the
EBP register value, a wrong address is the result, since
instead of a subtraction an addition is performed. The cast
reconverts the numnber into a signed 32 bit quantity that
is correctly subtracted from addr.
...
Regards,
Tim
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: