Bug 181390

Summary: cannot examine stack from non-$esp register in 32-bit mode
Product: [Fedora] Fedora Reporter: John Reiser <jreiser>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: cagney, jan.kratochvil, sundaram
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-6.5-13.fc6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-27 11:19:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Reiser 2006-02-13 19:47:41 UTC
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,
-----foo.S
_start: .globl _start
        nop
        int3
        movl %esp,%ebx
        int3  # examining memory from $ebx fails, from $esp succeeds
        nop
        nop
-----
$ gcc -m32 -o foo -nostartfiles -nostdlib foo.S
$ gdb foo


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

How reproducible:
Always

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.
3.
  

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 11:11:28 UTC

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 19:28:33 UTC
To be fixed in gdb-6.5-11.fc6, thanks for your bugreport.


Comment 3 Fedora Update System 2006-10-26 17:45:35 UTC
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 11:19:34 UTC
Formal mistake, state MODIFIED is invalid for FC bugs.