delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/09/10:58:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: problem of GDB with Fortran array
Date: Wed, 9 Jun 2004 15:50:30 +0200
Message-ID: <4C6526212238CD40AB0CB47EE48553118E385C@tatooine.de.tatm.thales>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Su, Hua" <hua DOT su AT thalesatm DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i59EwLKk020636

Dear all,

I'm new to this mailing list. Before I ask a question, I have searched the mailing list archive, but I have not found an answer. My problem is when I debug fortran source code using GDB, a problem will occur when using GDB command print to show elemnet of an array. But problem does not occur under Linux environment.

taking following small source code (test.for) as an example:

        dimension a(10)
        write(*,*)'This is a test.'
        call sub(a,10)
        write(*,*) a
        stop
        end

        subroutine sub(a,n)
        dimension a(n)
        do 100 i=1, 10
          a(i)=i
100     continue
        return
        end

After compiling using command, g77 -g -O test.for, we can use GDB to debug test.exe, but if you want to show content of some element of array a, the error occurs with the message:

Program received signal SIGSEGV, Segmentation fault.
0x0022f010 in ?? () 
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (at 0x22f010) will be abandoned.

BUT I have not met such problem in Linux environment.

My Cygwin version is         1.5.9-1
GDB is 20030919-1 (GNU gdb 2003-09-20-cvs (cygwin-special))

Many thanks for any help.

Best regards

H. Su



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019