From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23197 invoked by alias); 2 Nov 2005 02:39:40 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 23178 invoked by uid 22791); 2 Nov 2005 02:39:36 -0000 Received: from ausmtp02.au.ibm.com (HELO ausmtp02.au.ibm.com) (202.81.18.187) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 02 Nov 2005 02:39:36 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp02.au.ibm.com (8.12.10/8.12.10) with ESMTP id jA22XiGW154100 for ; Wed, 2 Nov 2005 13:33:44 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0208e0.au.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id jA22gXAr173848 for ; Wed, 2 Nov 2005 13:42:33 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11/8.13.3) with ESMTP id jA22dV4v022639 for ; Wed, 2 Nov 2005 13:39:31 +1100 Received: from [9.181.133.252] ([9.181.133.252]) by d23av02.au.ibm.com (8.12.11/8.12.11) with ESMTP id jA22dTNw022604 for ; Wed, 2 Nov 2005 13:39:30 +1100 Date: Wed, 02 Nov 2005 02:39:00 -0000 From: Wu Zhou To: gdb@sources.redhat.com Subject: The root cause for SEGV in evaluating fortran function call, any solution or suggestion? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-11/txt/msg00021.txt.bz2 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 >