Bug 181390 - cannot examine stack from non-$esp register in 32-bit mode
cannot examine stack from non-$esp register in 32-bit mode
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Kratochvil
Depends On:
  Show dependency treegraph
Reported: 2006-02-13 14:47 EST by John Reiser
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version: gdb-6.5-13.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-27 06:19:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Reiser 2006-02-13 14:47:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8) Gecko/20060126 Fedora/1.5-5 Firefox/1.5

Description of problem:
When debugging a 32-bit executable on x86_64, gdb does not allow examining the stack if pointed to by a non-$esp register.  For example,
_start: .globl _start
        movl %esp,%ebx
        int3  # examining memory from $ebx fails, from $esp succeeds
$ gcc -m32 -o foo -nostartfiles -nostdlib foo.S
$ gdb foo

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Build and debug the 32-bit test program in the Description.
2. Examine memory from $esp then from $ebx with the same value.

Actual Results:  (gdb) run
Starting program: /home/jreiser/foo
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0xffffe000

Program received signal SIGTRAP, Trace/breakpoint trap.
0x08048076 in _start ()
(gdb) x/i $pc
0x8048076 <_start+2>:   mov    %esp,%ebx
(gdb) stepi
0x08048078 in _start ()
(gdb) x/x $esp
0xffffce70:     0x00000001
(gdb) x/x $ebx
0xffffce70:     Cannot access memory at address 0xffffce70
(gdb) x/x 0xffffce70
0xffffce70:     0x00000001

Expected Results:  "x/x $ebx" should have succeeded, too, when %ebx has the same value as %esp and examining from $esp works.

Additional info:

Workaround apears to be: print the register, then use the contents as a literal address to examine.
Comment 1 Rahul Sundaram 2006-02-20 06:11:28 EST

These bugs are being closed since a large number of updates have been released
after the FC5 test1 and test2 releases. Kindly update your system by running yum
update as root user or try out the third and final test version of FC5 being
released in a short while and verify if the bugs are still present on the system
.Reopen or file new bug reports as appropriate after confirming the presence of
this issue. Thanks
Comment 2 Jan Kratochvil 2006-10-01 15:28:33 EDT
To be fixed in gdb-6.5-11.fc6, thanks for your bugreport.
Comment 3 Fedora Update System 2006-10-26 13:45:35 EDT
gdb-6.5-13.fc6 has been pushed for fc6, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 4 Jan Kratochvil 2007-01-27 06:19:34 EST
Formal mistake, state MODIFIED is invalid for FC bugs.

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