The root cause for SEGV in evaluating fortran function call, any solution or suggestion?

Wu Zhou
2005-11-02T02:39:40Z

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
>