public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
@ 2010-10-19  8:31 ` aburgess at broadcom dot com
  2010-10-19 15:11 ` aburgess at broadcom dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-10-19  8:31 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <aburgess at broadcom dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4986|0                           |1
        is obsolete|                            |

--- Comment #7 from Andrew Burgess <aburgess at broadcom dot com> 2010-10-19 08:30:41 UTC ---
Created attachment 5068
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5068
Support for multi-dimensional fortran arrays

Minor updates to patch to meeting coding standards. Changelog message removed
from patch file:

2010-10-19 Andrew Burgess <aburgess@broadcom.com>

      * valarith.c (value_subscripted_rvalue) Walk through
      multi-dimensional arrays to find the element type for the
      array. Allows the upper bound check to work with multi-dimensional
      arrays. Fix PR gdb/11104.
      * eval.c (evaluate_subexp_standard) Remove hack from
      multi_f77_subscript case now that multi-dimensional arrays are
      supported.  Fix PR gdb/11104.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
  2010-10-19  8:31 ` [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly aburgess at broadcom dot com
@ 2010-10-19 15:11 ` aburgess at broadcom dot com
  2010-10-19 15:12 ` aburgess at broadcom dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-10-19 15:11 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <aburgess at broadcom dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4987|0                           |1
        is obsolete|                            |

--- Comment #8 from Andrew Burgess <aburgess at broadcom dot com> 2010-10-19 15:10:24 UTC ---
Created attachment 5069
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5069
New test in patch format

Test for this issue in patch format. ChangeLog message included before patch.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
  2010-10-19  8:31 ` [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly aburgess at broadcom dot com
  2010-10-19 15:11 ` aburgess at broadcom dot com
@ 2010-10-19 15:12 ` aburgess at broadcom dot com
  2011-01-12 16:16 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-10-19 15:12 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <aburgess at broadcom dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5068|0                           |1
        is obsolete|                            |

--- Comment #9 from Andrew Burgess <aburgess at broadcom dot com> 2010-10-19 15:12:08 UTC ---
Created attachment 5070
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5070
Support for multi-dimensional fortran arrays

Updated to include the ChangeLog entry as text before the patch content.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-10-19 15:12 ` aburgess at broadcom dot com
@ 2011-01-12 16:16 ` cvs-commit at gcc dot gnu.org
  2011-01-12 16:22 ` jan.kratochvil at redhat dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-01-12 16:16 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-01-12 16:16:33 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    jkratoch@sourceware.org    2011-01-12 16:16:25

Modified files:
    gdb            : ChangeLog dwarf2read.c eval.c 
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.fortran: multi-dim.exp multi-dim.f90 

Log message:
    gdb/
    PR fortran/11104 and DWARF unbound arrays detection.
    * dwarf2read.c (read_subrange_type): Set zero length on unspecified
    upper bound.  Set TYPE_HIGH_BOUND_UNDEFINED if not language_ada on
    unspecified upper bound.
    * eval.c (evaluate_subexp_standard) <multi_f77_subscript>: Remove
    variables array_size_array, tmp_type and offset_item.  New variable
    array.  Remove call to f77_get_upperbound.  New variables array_type
    and index.  Call value_subscripted_rvalue for each dimenasion.  Remove
    the final call to deprecated_set_value_type.

    gdb/testsuite/
    PR fortran/11104 and DWARF unbound arrays detection.
    * gdb.fortran/multi-dim.exp: New file.
    * gdb.fortran/multi-dim.f90: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12463&r2=1.12464
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.494&r2=1.495
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/eval.c.diff?cvsroot=src&r1=1.145&r2=1.146
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2549&r2=1.2550
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.fortran/multi-dim.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.fortran/multi-dim.f90.diff?cvsroot=src&r1=NONE&r2=1.1

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-01-12 16:16 ` cvs-commit at gcc dot gnu.org
@ 2011-01-12 16:22 ` jan.kratochvil at redhat dot com
  2011-04-05 14:44 ` smirta at mail dot ru
  2011-04-21 11:25 ` smirta at mail dot ru
  6 siblings, 0 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-01-12 16:22 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com
         Resolution|                            |FIXED

--- Comment #11 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-01-12 16:22:02 UTC ---
Fixed by the commit based on Andrew Burgess's patch.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-01-12 16:22 ` jan.kratochvil at redhat dot com
@ 2011-04-05 14:44 ` smirta at mail dot ru
  2011-04-21 11:25 ` smirta at mail dot ru
  6 siblings, 0 replies; 13+ messages in thread
From: smirta at mail dot ru @ 2011-04-05 14:44 UTC (permalink / raw)
  To: gdb-prs

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

Saha Smirnovsky <smirta at mail dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |smirta at mail dot ru
            Version|7.1                         |HEAD
         Resolution|FIXED                       |
   Target Milestone|7.1                         |7.3

--- Comment #12 from Saha Smirnovsky <smirta at mail dot ru> 2011-04-05 14:42:59 UTC ---
gdb gives wrong results in case when one-dimensional array is passed as
argument to subroutine and is treated as multidimensional array with dimensions
which were passed as arguments.

Please see this Fortran code:

test.f90
===
  program test_array
  integer foo(4)

  do I=1,4
    foo(I)=I
  enddo
  call test(foo,2)
  end


  subroutine test(M,N)
  integer  N
  integer  M(N,N)

  do J=1,N
  do I=1,N
    write(*,*) "I,J,M = ",I,J,M(I,J)
  enddo
  enddo
  end
===

This is output:

$ gfortran -ggdb -o test test.f90
$ ./test
 I,J,M =            1           1           1
 I,J,M =            2           1           2
 I,J,M =            1           2           3
 I,J,M =            2           2           4

This is debugging:
$ gdb test
...
(gdb) break test
Breakpoint 1 at 0x804863e: file test.f90, line 11.
(gdb) run
Starting program: /home/????/test 

Breakpoint 1, test (m=..., n=2) at test.f90:11
11    subroutine test(M,N)
(gdb) print M(2,2)
$1 = 2

I use gdb 7.3.50.20110405

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
       [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-04-05 14:44 ` smirta at mail dot ru
@ 2011-04-21 11:25 ` smirta at mail dot ru
  6 siblings, 0 replies; 13+ messages in thread
From: smirta at mail dot ru @ 2011-04-21 11:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #13 from Saha Smirnovsky <smirta at mail dot ru> 2011-04-21 11:25:08 UTC ---
This bug is temporary fixed in archer-jankratochvil-vla branch

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
  2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
                   ` (4 preceding siblings ...)
  2010-09-16  8:03 ` aburgess at broadcom dot com
@ 2010-09-16  8:45 ` aburgess at broadcom dot com
  5 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-09-16  8:45 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From aburgess at broadcom dot com  2010-09-16 08:45 -------
Created an attachment (id=4987)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4987&action=view)
Updated testcase

Finally got the Fortran tests running, slight update to the test case.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #4977 is|0                           |1
           obsolete|                            |


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

------- 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] 13+ messages in thread

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
  2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
                   ` (3 preceding siblings ...)
  2010-09-12 14:53 ` aburgess at broadcom dot com
@ 2010-09-16  8:03 ` aburgess at broadcom dot com
  2010-09-16  8:45 ` aburgess at broadcom dot com
  5 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-09-16  8:03 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From aburgess at broadcom dot com  2010-09-16 08:03 -------
Created an attachment (id=4986)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4986&action=view)
Updated patch

This should apply to the current CVS head.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #4976 is|0                           |1
           obsolete|                            |


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

------- 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] 13+ messages in thread

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
  2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
                   ` (2 preceding siblings ...)
  2010-09-12 14:43 ` aburgess at broadcom dot com
@ 2010-09-12 14:53 ` aburgess at broadcom dot com
  2010-09-16  8:03 ` aburgess at broadcom dot com
  2010-09-16  8:45 ` aburgess at broadcom dot com
  5 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-09-12 14:53 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From aburgess at broadcom dot com  2010-09-12 14:53 -------
Created an attachment (id=4977)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4977&action=view)
Test for this issue.

The multi-dim.tar.bz2 contains a new test that should cover this issue. It
would need adding to gdb/testsuite/gdb.fortran. The only thing is, I've not
been able to run any of the Fortran tests myself as I'm struggling to get them
to compile, I don't know if this is just my setup or a general issue.
I'm working with gdb-7.2 & gcc 4.4.3.

I've checked that this new test works using a dirty hack :) but someone who can
actually get the Fortran tests running should check this works correctly before
it's committed into the tree.

-- 


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

------- 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] 13+ messages in thread

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
  2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
  2010-01-26 16:09 ` [Bug fortran/11104] " at_gdb at mathalacarte dot com
  2010-05-31  9:49 ` fenixk19 at mail dot ru
@ 2010-09-12 14:43 ` aburgess at broadcom dot com
  2010-09-12 14:53 ` aburgess at broadcom dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: aburgess at broadcom dot com @ 2010-09-12 14:43 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From aburgess at broadcom dot com  2010-09-12 14:43 -------
Created an attachment (id=4976)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4976&action=view)
Proposed patch

Fortran multi-dimensional arrays are of type:
   ARRAY of ( ARRAY of ( BASETYPE ) )
Nested to the required depth.
The code used to fetch a single element out of an array could previously only
handle (ARRAY of BASETYPE), and so before calling this we would modify the type
of the array. However, this was leading to other problems when we try to bounds
check the array access.

This patch changes the array access code so that is can peel off all the layers
of ARRAY of ARRAY of ... to get to the BASETYPE.


-- 


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

------- 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] 13+ messages in thread

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
  2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
  2010-01-26 16:09 ` [Bug fortran/11104] " at_gdb at mathalacarte dot com
@ 2010-05-31  9:49 ` fenixk19 at mail dot ru
  2010-09-12 14:43 ` aburgess at broadcom dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: fenixk19 at mail dot ru @ 2010-05-31  9:49 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From fenixk19 at mail dot ru  2010-05-31 09:49 -------
Confirming on version 7.1

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
            Version|7.0                         |7.1


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

------- 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] 13+ messages in thread

* [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly.
  2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
@ 2010-01-26 16:09 ` at_gdb at mathalacarte dot com
  2010-05-31  9:49 ` fenixk19 at mail dot ru
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: at_gdb at mathalacarte dot com @ 2010-01-26 16:09 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From at_gdb at mathalacarte dot com  2010-01-26 16:09 -------
Just tried gdb-7.0.1 on my gentoo system, and it has the same problem, this time 
noticed for a one-dimensional array.  The error message is the same.  Version 6.8 
works.

-- 


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

------- 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] 13+ messages in thread

end of thread, other threads:[~2011-04-21 11:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-11104-4717@http.sourceware.org/bugzilla/>
2010-10-19  8:31 ` [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortran arrays correctly aburgess at broadcom dot com
2010-10-19 15:11 ` aburgess at broadcom dot com
2010-10-19 15:12 ` aburgess at broadcom dot com
2011-01-12 16:16 ` cvs-commit at gcc dot gnu.org
2011-01-12 16:22 ` jan.kratochvil at redhat dot com
2011-04-05 14:44 ` smirta at mail dot ru
2011-04-21 11:25 ` smirta at mail dot ru
2009-12-17 18:42 [Bug fortran/11104] New: " at_gdb at mathalacarte dot com
2010-01-26 16:09 ` [Bug fortran/11104] " at_gdb at mathalacarte dot com
2010-05-31  9:49 ` fenixk19 at mail dot ru
2010-09-12 14:43 ` aburgess at broadcom dot com
2010-09-12 14:53 ` aburgess at broadcom dot com
2010-09-16  8:03 ` aburgess at broadcom dot com
2010-09-16  8:45 ` aburgess at broadcom 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).