Bug 181390 - cannot examine stack from non-$esp register in 32-bit mode
Summary: cannot examine stack from non-$esp register in 32-bit mode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-02-13 19:47 UTC by John Reiser
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version: gdb-6.5-13.fc6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-27 11:19:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.



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