From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4423 invoked by alias); 2 Nov 2005 14:53:04 -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 4394 invoked by uid 22791); 2 Nov 2005 14:53:01 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 02 Nov 2005 14:53:01 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1EXJz1-0007P0-0S; Wed, 02 Nov 2005 09:52:59 -0500 Date: Wed, 02 Nov 2005 14:53:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb@sources.redhat.com Subject: Re: The root cause for SEGV in evaluating fortran function call, any solution or suggestion? Message-ID: <20051102145258.GA28372@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-11/txt/msg00033.txt.bz2 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