This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
The root cause for SEGV in evaluating fortran function call, anysolution or suggestion?
- From: Wu Zhou <woodzltc at cn dot ibm dot com>
- To: gdb at sources dot redhat dot com
- Date: Wed, 2 Nov 2005 10:43:03 +0800 (CST)
- Subject: The root cause for SEGV in evaluating fortran function call, anysolution or suggestion?
- References: <Pine.LNX.4.63.0508221743470.10411@linux.site>
Hi all,
I had found the reason why gdb will drop into SEGV when evaluating the
fortran function calls. In g77 (gfortran might be the same), when we try
to call FUNC_NAME (ARGS), the ARGS is passed as the pointer to the real
parameters.
While we issue "print FUNC_NAME (ARGS), these ARGS are passed as the
original types. So fortran code can't handle that and SEGV occurs.
Considering this special argument-passing mechanism, do we have any
workaround for it in gdb's evaluation code? Create a dummy memory address
for the arguments and pass that address instead? or any others?
Your comments are highly appreciated. Thanks a lot.
Regards
- Wu Zhou
On Mon, 22 Aug 2005, Wu Zhou wrote:
>
> I just found a problem while using gdb to debug fortran program: gdb will
> drop into SEGV error while trying to print the result of a function call.
> I had tried the same test on FC4, SLES9, FC2 and RH9, all reported the
> same error.
>
> Anyone has success experience with this? If you do, please tell me
> the configuration. Thanks a buch for that in advance!
>
> Maybe I need to try more ancient configuration?
>
> Regards
> - Wu Zhou
>