lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Oh, I read that again ... and I think I got it: r9 is a
> NON-volatile register in EABI, but a volatile register in iOS 3.0.
> That would imply it may get trashed by any C call. Yuck.
> 
> Actually that register is used to hold a mask for bytecode
> decoding. To test my theory, can you try to edit buildvm_arm.dasc
> and swap the register assignments of DISPATCH and MASKR8? [This
> requires Lua in the path to rebuild some generated files.]
> 
> If my theory is correct, then this ought to crash hard and fast.

Crashed as predicted:

Program received signal:  “EXC_BAD_ACCESS”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.1 (8G4)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
Previous frame inner to this frame (gdb could not unwind past this frame)
Previous frame inner to this frame (gdb could not unwind past this frame)
(gdb) bt
#0  0x00003fbc in lj_BC_JFUNCV ()
#1  0x00009cd8 in lj_tab_newkey ()

> A fix for the r9 issue would be somewhat complicated, though.

Yeah, I get the point, we got one non-volatile register less in iOS, so it ruins the whole concept of having fast MASKR8 constant kept in register :(

>> #define __APPLE__ 1
> 
> Looks like that's the only useful indication for the different ABI.

This is also the way many projects I've seen adding Apple OSes quirks into the code.

Let me know if I can be any more help regarding iOS issues,
-- 
Adam Strzelecki