This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problem of GDB with Fortran array


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]