RE: The root cause for SEGV in evaluating fortran function call, any solution or suggestion?

Dave Korn
2005-11-04T11:20:09Z

Mark Kettenis wrote:
>> Date: Thu, 3 Nov 2005 11:14:51 +0800 (CST)
>> From: Wu Zhou <woodzltc@cn.ibm.com>
>>
>> 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....