From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20678 invoked by alias); 23 Sep 2011 15:20:29 -0000 Received: (qmail 20659 invoked by uid 22791); 23 Sep 2011 15:20:24 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RP_MATCHES_RCVD,SPF_HELO_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Sep 2011 15:20:08 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R77Xq-0001a5-57 for gdb@sources.redhat.com; Fri, 23 Sep 2011 17:20:06 +0200 Received: from linbob27.ing.unibo.it ([137.204.240.127]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Sep 2011 17:20:06 +0200 Received: from lurkos.usenet by linbob27.ing.unibo.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Sep 2011 17:20:06 +0200 To: gdb@sources.redhat.com From: Lurkos Subject: cannot print allocatable arrays Date: Fri, 23 Sep 2011 15:20:00 -0000 Message-ID: <20110923144610.10149.52279.XPN@L622243018051.user.x-privat.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit User-Agent: XPN/1.2.6 (Street Spirit ; Linux) X-OpenPGP-Key-ID: 135E4D8D X-OpenPGP-Key-Fprint: 1B57EB95F6191D6C1056B6D3BFCA1BDA135E4D8D X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00103.txt.bz2 I'm using gdb 7.0.1-debian and gfortran 4.4.5 on Debian squeeze amd64. I'm not able to print arrays that are declared as allocatable. It seems that gdb is not able to detect the correct size of the array allocated run-time. Is there a different way to print the values in this case? Thank you. +++ Test case 1: allocatable array +++ ---------- code ---------- program arrshow implicit none integer,parameter :: n = 5 integer,allocatable,dimension(:) :: vect integer :: i allocate(vect(n)) do i=1,n vect(i) = i enddo write(unit=*,fmt=*) vect deallocate(vect) endprogram arrshow ---------- gdb ---------- (gdb) p vect $1 = () (gdb) ptype vect type = integer(kind=4) (0:-1) +++ Test case 2: static array +++ ---------- code ---------- program arrshow implicit none integer,parameter :: n = 5 integer,dimension(n) :: vect integer :: i do i=1,n vect(i) = i enddo write(unit=*,fmt=*) vect endprogram arrshow ---------- gdb ---------- (gdb) p vect $1 = (1, 2, 3, 4, 5) (gdb) ptype vect type = integer(kind=4) (5) -- Lurkos