public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable>
@ 2009-05-14 23:32 jim dot conyngham at amd dot com
  2009-05-14 23:34 ` [Bug mi/10154] " jim dot conyngham at amd dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jim dot conyngham at amd dot com @ 2009-05-14 23:32 UTC (permalink / raw)
  To: gdb-prs

Using GDB 6.6.50.20070726-cvs on any gfortran program on OpenSuse 10.3 Linux on
AMD 64-bit phenom hardware, GDB will not display the contents of any of the SIMD
SSE XMM registers.  Any command to print or display the contents returns "<error
reading variable>"

Console log showing repro follows:

ACML@mako54:~/acmlbugs/fix.ilaenv> gdb --version
GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".

ACML@mako54:~/acmlbugs/fix.ilaenv> uname -a
Linux mako54 2.6.22.5-31-default #1 SMP 2007/09/21 22:29:00 UTC x86_64 x86_64
x86_64 GNU/Linux


ACML@mako54:~/acmlbugs/fix.ilaenv> cat gdbtest.f
      PROGRAM MAIN
      IMPLICIT NONE
      INTEGER I
      DOUBLE PRECISION X, Y, Z
*
*                       Fortran 95 Intrinsics:
      INTRINSIC DIGITS, EPSILON, HUGE, KIND
      INTRINSIC MINEXPONENT, MAXEXPONENT, NEAREST
      INTRINSIC PRECISION, RADIX, RANGE, RRSPACING, SPACING
      INTRINSIC TINY
*
*
      X = 0.0D0
      I = DIGITS (X)
      WRITE (*,6004) I
      I = KIND (X)
      WRITE (*, 6006) I
      I = MINEXPONENT (X)
      WRITE (*, 6007) I
      I = MAXEXPONENT (X)
      WRITE (*, 6008) I
      I = PRECISION (X)
      WRITE (*, 6009) I
      I = RADIX (X)
      WRITE (*, 6010) I
      I = RANGE (X)
      WRITE (*, 6011) I
      X = HUGE (X)
      WRITE (*,6002) X
      X = EPSILON (X)
      WRITE (*, 6005) X
      X = TINY (X)
      WRITE (*, 6012) X
*
*
 6001 FORMAT (1X,A)
 6003 FORMAT (1X,D18.10, 1X,D18.10)
 6004 FORMAT (1X,'DIGITS()      = ',I6)
 6006 FORMAT (1X,'KIND()        = ',I6)
 6007 FORMAT (1X,'MINEXPONENT() = ',I6)
 6008 FORMAT (1X,'MAXEXPONENT() = ',I6)
 6009 FORMAT (1X,'PRECISION()   = ',I6)
 6010 FORMAT (1X,'RADIX()       = ',I6)
 6011 FORMAT (1X,'RANGE()       = ',I6)
 6002 FORMAT (1X,'HUGE()    = ',D18.10)
 6005 FORMAT (1X,'EPSILON() = ',D18.10)
 6012 FORMAT (1X,'TINY()    = ',D18.10)
 6100 FORMAT (1X,A,1X,I6,1X,A)
*
      END
*****************************************************************


ACML@mako54:~/acmlbugs/fix.ilaenv> gfortran -g -ffpe-trap=invalid gdbtest.f
ACML@mako54:~/acmlbugs/fix.ilaenv> file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.4,
dynamically linked (uses shared libs), not stripped

ACML@mako54:~/acmlbugs/fix.ilaenv> gdb a.out
GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-suse-linux"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x400d50
(gdb) r
Starting program: /opt/ACML/acmlbugs/fix.ilaenv/a.out

Breakpoint 1, 0x0000000000400d50 in main ()
(gdb) b MAIN__
Breakpoint 2 at 0x400893: file gdbtest.f, line 1.
(gdb) c
Continuing.

Breakpoint 2, MAIN__ () at gdbtest.f:1
1             PROGRAM MAIN
Current language:  auto; currently fortran
(gdb) n 10
 DIGITS()      =     53
 KIND()        =      8
 MINEXPONENT() =  -1021
 MAXEXPONENT() =   1024
22            I = PRECISION (X)
(gdb) info all-registers
rax            0x0      0
rbx            0x2b1641484be0   47374584531936
rcx            0x1      1
rdx            0x60a300 6333184
rsi            0x2b1641cb41e0   47374593114592
rdi            0x7fff6983f360   140734963643232
rbp            0x7fff6983f500   0x7fff6983f500
rsp            0x7fff6983f360   0x7fff6983f360
r8             0x6094c0 6329536
r9             0x0      0
r10            0x0      0
r11            0x246    582
r12            0x0      0
r13            0x7fff6983f5f0   140734963643888
r14            0x0      0
r15            0x0      0
rip            0x400a82 0x400a82 <MAIN__+506>
eflags         0x246    [ PF ZF IF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
st0            0        (raw 0x00000000000000000000)
st1            0        (raw 0x00000000000000000000)
st2            0        (raw 0x00000000000000000000)
st3            0        (raw 0x00000000000000000000)
st4            0        (raw 0x00000000000000000000)
st5            0        (raw 0x00000000000000000000)
st6            0        (raw 0x00000000000000000000)
st7            0        (raw 0x00000000000000000000)
fctrl          0x37e    894
fstat          0x0      0
ftag           0xffff   65535
fiseg          0x0      0
fioff          0x0      0
foseg          0x0      0
fooff          0x0      0
fop            0x0      0
xmm0           <error reading variable>
xmm1           <error reading variable>
xmm2           <error reading variable>
xmm3           <error reading variable>
xmm4           <error reading variable>
xmm5           <error reading variable>
xmm6           <error reading variable>
xmm7           <error reading variable>
xmm8           <error reading variable>
xmm9           <error reading variable>
xmm10          <error reading variable>
xmm11          <error reading variable>
xmm12          <error reading variable>
xmm13          <error reading variable>
xmm14          <error reading variable>
xmm15          <error reading variable>
mxcsr          0x1f00   [ DM ZM OM UM PM ]
(gdb) p $rax
$1 = 0
(gdb) p $xmm0
$2 = <error reading variable>
(gdb) p $xmm3
$3 = <error reading variable>
(gdb) p $xmm8
$4 = <error reading variable>
(gdb) q
The program is running.  Exit anyway? (y or n) y

-- 
           Summary: GDB 6.6 won't display XMM registers: <error reading
                    variable>
           Product: gdb
           Version: 6.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: mi
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jim dot conyngham at amd dot com
                CC: gdb-prs at sourceware dot org,jim dot conyngham at amd
                    dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug mi/10154] GDB 6.6 won't display XMM registers: <error reading variable>
  2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
@ 2009-05-14 23:34 ` jim dot conyngham at amd dot com
  2009-05-15 17:48 ` jim dot conyngham at amd dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jim dot conyngham at amd dot com @ 2009-05-14 23:34 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jim dot conyngham at amd dot com  2009-05-14 23:34 -------
Created an attachment (id=3935)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3935&action=view)
This is the fortran source program.  (tar -cvj format)


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug mi/10154] GDB 6.6 won't display XMM registers: <error reading variable>
  2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
  2009-05-14 23:34 ` [Bug mi/10154] " jim dot conyngham at amd dot com
@ 2009-05-15 17:48 ` jim dot conyngham at amd dot com
  2009-05-16  8:08 ` nickrob at snap dot net dot nz
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jim dot conyngham at amd dot com @ 2009-05-15 17:48 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jim dot conyngham at amd dot com  2009-05-15 17:48 -------
I have downloaded, built and installed GDB version 6.8, and the same bug is
still present.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|6.6                         |6.8


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug mi/10154] GDB 6.6 won't display XMM registers: <error reading variable>
  2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
  2009-05-14 23:34 ` [Bug mi/10154] " jim dot conyngham at amd dot com
  2009-05-15 17:48 ` jim dot conyngham at amd dot com
@ 2009-05-16  8:08 ` nickrob at snap dot net dot nz
  2009-05-18 17:32 ` [Bug fortran/10154] " jim dot conyngham at amd dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nickrob at snap dot net dot nz @ 2009-05-16  8:08 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From nickrob at snap dot net dot nz  2009-05-16 08:07 -------
(In reply to comment #2)
> I have downloaded, built and installed GDB version 6.8, and the same bug is
> still present.

Yes, but it's not an MI bug but probably a Fortran one.  Perhaps close this one
and open a new one.  Since it happens with any Fortran program you probably
don't need to include an attachment.  It might even be a compiler problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/10154] GDB 6.6 won't display XMM registers: <error reading variable>
  2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
                   ` (2 preceding siblings ...)
  2009-05-16  8:08 ` nickrob at snap dot net dot nz
@ 2009-05-18 17:32 ` jim dot conyngham at amd dot com
  2009-05-18 18:08 ` jim dot conyngham at amd dot com
  2009-05-19 16:02 ` jim dot conyngham at amd dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jim dot conyngham at amd dot com @ 2009-05-18 17:32 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jim dot conyngham at amd dot com  2009-05-18 17:31 -------
Changing the "component" from MI (machine interface) to Fortran.   (Sorry for 
the inconvenience. I was mislead by the error message.)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|mi                          |fortran


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/10154] GDB 6.6 won't display XMM registers: <error reading variable>
  2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
                   ` (3 preceding siblings ...)
  2009-05-18 17:32 ` [Bug fortran/10154] " jim dot conyngham at amd dot com
@ 2009-05-18 18:08 ` jim dot conyngham at amd dot com
  2009-05-19 16:02 ` jim dot conyngham at amd dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jim dot conyngham at amd dot com @ 2009-05-18 18:08 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jim dot conyngham at amd dot com  2009-05-18 18:08 -------
Sorry for the confusion -- I did not realize at first that this issue was 
specific to Fortran source programs.

After more investigation, and debugging with the GDB sources, I've found that 
the problem is you can't display the XMM registers if the source language is 
Fortran.   But they do display OK if the source language is C or C++.

A workaround for the problem is "set source c++" while debugging Fortran.

The problem is that the $xmm# registers are defined as objects of 
TYPE_CODE_UNION and the Fortran language does not support unions.  (The 
EQUIVALENCE statement notwithstanding.)

When a user enters a "p $xmm0" command, this object is passed to the f_val_print
() function in gdb/f-valprint.c.  The switch therein does not have a case 
statement for that type code so the default case is executed, which throws and 
error.

I've created my own local fix by implementing a case TYPE_CODE_UNION clause in 
f-valprint.c, which is good enough for my own purposes as a temporary hack.  
I'm attaching the diff of the patch below for information only; I am NOT 
suggesting that this is an acceptable long-term solution.

Presumably, other languages besides Fortran that don't support the union type 
would have the same problem.

Presumably, the same problem will be encountered when AVX registers are 
supported by GDB.  (I assume someone at Intel is working on this.)

-----------------------------------
605,620c605
<       break;
< 
<     case TYPE_CODE_UNION:
<       /* This is not a valid Fortran data type, but if the user is
<        * debugging a Fortran source and tries to display a SIMD register
<        * e.g., "print $xmm0"  then we wind up here.
<        * HACK: pass this to c++ language object
<        */
<       {
<     	const struct language_defn * lang_cpp = language_def (language_cplus);
<     	if ((lang_cpp != NULL) && (lang_cpp != current_language))
<    	      return lang_cpp->la_val_print (type, valaddr, embedded_offset,
<     		     address, stream, format,
<     		     deref_ref, recurse, pretty);
<     	// else FALL THRU.
<       }
---
>       break;     


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/10154] GDB 6.6 won't display XMM registers: <error reading variable>
  2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
                   ` (4 preceding siblings ...)
  2009-05-18 18:08 ` jim dot conyngham at amd dot com
@ 2009-05-19 16:02 ` jim dot conyngham at amd dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jim dot conyngham at amd dot com @ 2009-05-19 16:02 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jim dot conyngham at amd dot com  2009-05-19 16:02 -------
Apparently this is fixed in the current sources.

The version 6.8 that I downloaded from ftp.gnu.org/gnu/gdb was packed up 27 
March 2008.  The changelogs in the current sources indicate that support for 
TYPE_CODE_UNION was added to f-valprint.c in April 2008.




-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10154

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-05-19 16:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-14 23:32 [Bug mi/10154] New: GDB 6.6 won't display XMM registers: <error reading variable> jim dot conyngham at amd dot com
2009-05-14 23:34 ` [Bug mi/10154] " jim dot conyngham at amd dot com
2009-05-15 17:48 ` jim dot conyngham at amd dot com
2009-05-16  8:08 ` nickrob at snap dot net dot nz
2009-05-18 17:32 ` [Bug fortran/10154] " jim dot conyngham at amd dot com
2009-05-18 18:08 ` jim dot conyngham at amd dot com
2009-05-19 16:02 ` jim dot conyngham at amd dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).