Jon Griffiths tntjpgriff@tsnxt.co.uk writes:
This is a resubmit of the previous patch. It now manages to do the setjmp/longjmp stuff 90% in C rather than asm. It also implements setjmp3 which is needed for programs compiled with VC++ v4.0+, and it should fix the compilation problem reported on cemw.
You should _really_ use register functions instead of inline assembly. Then you can do setjmp/longjmp 100% in C.
You should _really_ use register functions instead of inline assembly. Then you can do setjmp/longjmp 100% in C.
OK, new patch coming up shortly. I hadn't grokked register functions at all.
On a related note, going forward we should really support __thiscall in the spec files too, and pass %ecx as a function argument instead of the trickery needed now to get the class pointer, its not very nice.... I'll have a look at this when I get back.
Cheers, Jon
Hi,
You should _really_ use register functions instead of inline assembly. Then you can do setjmp/longjmp 100% in C.
I can't get this to build cleanly. Changing the type to register in the .spec, and adding a CONTEXT86 * as the last parameter in the prototype gave me an unresolved external to CALL32_Regs when making the .so. Adding IMPORTS = ntdll to the makefile (as in kernel32, which uses reg functions) got rid of that but now gives me the warning:
/usr/bin/ld: warning: type and size of dynamic symbol `CALL32_Regs' are not defined
Ugh. I guess there is something I need to change in my Makefile to get this to work? Although it builds, it dies, esp is not set correctly in the context structure. dereferencing esp to get the jump return address segfaults.
I'll resubmit when I'm back from travelling, once I understand whats going on.
Cheers, Jon