This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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]

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


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 
> 


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