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]

Re: problem of GDB with Fortran array

At 09:50 AM 6/9/2004, you wrote:
>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.

Could just be the "new" annoyance of gdb reported to this list earlier
caused by an internal call to IsBadWritePtr().  If it is, you can ignore
this problems.  Just try just continuing.  You may have to make multiple 
attempts at this.  If that's not it, I don't have further ideas for you
(beyond the obvious further debugging).

Larry Hall                    
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     

Unsubscribe info:
Problem reports:

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