This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: The root cause for SEGV in evaluating fortran function call, any solution or suggestion?
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Mark Kettenis'" <mark dot kettenis at xs4all dot nl>,<woodzltc at cn dot ibm dot com>
- Cc: <drow at false dot org>,<gdb at sources dot redhat dot com>
- Date: Fri, 4 Nov 2005 11:20:04 -0000
- Subject: RE: The root cause for SEGV in evaluating fortran function call, any solution or suggestion?
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....