Bug 136700

Summary: 64-bit PowerPC GDB can't fetch FPSCR
Product: [Fedora] Fedora Reporter: Andrew Cagney <cagney>
Component: kernelAssignee: David Woodhouse <dwmw2>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:06:32 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:
Bug Depends On:    
Bug Blocks: 116894    

Description Andrew Cagney 2004-10-21 19:41:42 UTC
GDB can't fetch the PowerPC's FPSCR register: 

  (gdb) print $fpscr
  reading register fpscr (#70): Input/output error.
  (gdb)

as occures when GDB is doing an inferior function call.

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

 2.6.9-rc4

strace shows:

  ptrace(PTRACE_PEEKUSER, 503, 0x288, 0xffffcdb0) = -1 EIO

and grubbing the headers:

  #define PT_FPR0 48
  define PT_FPSCR (PT_FPR0 + 32 + 1)
  (gdb) print/x (48 + 32 + 1) * 8
  $1 = 0x288

suggests that the value is correct.

Comment 1 David Woodhouse 2004-10-25 22:22:33 UTC
See bug #91727. 

The value of PT_FPSCR for 64-bit userspace is different to the value
for 32-bit. This is because a 'double' is worth two longs for 32-bit
code, and only one for 64-bit code.

I think the kernel is doing the right thing -- if there's a kernel bug
it's purely the evilness of the way the interface is done. If we're
going to start criticising the ptrace interface... :)

Closing NOTABUG. Feel free to argue if you feel strongly ;)

Comment 2 Andrew Cagney 2004-10-26 00:53:05 UTC

*** This bug has been marked as a duplicate of 91727 ***

Comment 3 Red Hat Bugzilla 2006-02-21 19:06:32 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.