I'm trying to get DUnit2 to work under 64 bits, but I'm stumped by what this method does, not to mention how to convert it to 64 bits. Pure Pascal is better, but since it belongs to the stack (ebp), this may not be possible.
function CallerAddr: Pointer; assembler; const CallerIP = $4; asm mov eax, ebp call IsBadPointer test eax,eax jne @@Error mov eax, [ebp].CallerIP sub eax, 5 // 5 bytes for call push eax call IsBadPointer test eax,eax pop eax je @@Finish @@Error: xor eax, eax @@Finish: end;
Nicholas ring
source share