From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14362 invoked by alias); 4 Nov 2005 11:20:09 -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 14332 invoked by uid 22791); 4 Nov 2005 11:20:06 -0000 Received: from host217-40-213-68.in-addr.btopenworld.com (HELO SERRANO.CAM.ARTIMI.COM) (217.40.213.68) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 04 Nov 2005 11:20:06 +0000 Received: from espanola ([192.168.1.110]) by SERRANO.CAM.ARTIMI.COM with Microsoft SMTPSVC(6.0.3790.1830); Fri, 4 Nov 2005 11:20:02 +0000 From: "Dave Korn" To: "'Mark Kettenis'" , Cc: , Subject: RE: The root cause for SEGV in evaluating fortran function call, any solution or suggestion? Date: Fri, 04 Nov 2005 11:20:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <200511032134.jA3LYDsT017248@elgar.sibelius.xs4all.nl> Message-ID: X-SW-Source: 2005-11/txt/msg00096.txt.bz2 Mark Kettenis wrote: >> Date: Thu, 3 Nov 2005 11:14:51 +0800 (CST) >> From: Wu Zhou >> >> Maybe we can convert the argument to its pointer before we enter into >> call_function_by_hand (evaluate_subexp_standard: case OP_FUNCALL)? >> Normally what function you will use to allocate memory on the stack? I >> am not very familar with that kind of code. Thanks! > > Allocating memory on the stack is actually quite eazy. Just > substract/add the amount of space you need from/to the stack pointer, > and use the new/old stack pointer as the address for the memory. > Whether you should substract or add depends on whether the stack grows > downward or upward. Use gdbarch_inner_than(gdbarch, 1, 2) to check. > There's quite a bit of code in infcall.c that uses this trick. > > Mark ... but beware of the red zone on 64-bit x86, right .... ? [e.g. see http://sources.redhat.com/ml/gdb-patches/2003-08/msg00092.html ] cheers, DaveK -- Can't think of a witty .sigline today....