This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: The root cause for SEGV in evaluating fortran function call, any solution or suggestion?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Wu Zhou <woodzltc at cn dot ibm dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 2 Nov 2005 09:52:58 -0500
- Subject: Re: The root cause for SEGV in evaluating fortran function call, any solution or suggestion?
- References: <Pine.LNX.4.63.0508221743470.10411@linux.site> <Pine.LNX.4.63.0511021033530.3549@linux.site>
On Wed, Nov 02, 2005 at 10:43:03AM +0800, Wu Zhou wrote:
> 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?
I don't think there's any way to handle that right now: you'll have to
add one. I am not sure where in the call-function process it should
be. Probably, you will also need a way to allocate them - on the stack
would be better than malloc, which is how gdb usually allocates memory.
--
Daniel Jacobowitz
CodeSourcery, LLC