James Bielman wrote:
What if you run the stepper in interpreted mode?
I'm not entirely sure how to try this---I'll read the documentation tomorrow and give this a shot.
(asdf:oos 'asdf:load-source-op :cffi) (step (test-struct.5)) Or (step (with-foreign-object...))
What if you call (ffi:memory-as *the-s-s-ch* ffi:uint8/char/...) directly?
That seems to work
Uhoh, then it's likely not the FFI. Please investigate.
FWIW, in clisp you obtain the disassembly via (sys::disassemble-closures (lambda () (declare (compile)) (with-foreign-object (s 's5) (setf (foreign-slot-value s 's5 'a) 42) (foreign-slot-value s 's5 'a))) t)
Regards, Jorg Hohle.
"Hoehle, Joerg-Cyril" Joerg-Cyril.Hoehle@t-systems.com writes:
Uhoh, then it's likely not the FFI. Please investigate.
It looks like the problem is with FFI:UNSIGNED-FOREIGN-ADDRESS and FFI:FOREIGN-ADDRESS-UNSIGNED expecting and returning 32-bit integers:
[ ...with *print-base* set to 16... ] CFFI[47]> (ffi:with-foreign-object (x 'ffi:int) (print (ffi:foreign-address x)) (print (ffi:foreign-address-unsigned (ffi:foreign-address x))) nil)
#<FOREIGN-ADDRESS #x00007FFFFFEF3750> FFEF3750 NIL
CFFI[49]> (ffi:unsigned-foreign-address #x100000000)
*** - not a 32-bit integer: 100000000 The following restarts are available: ABORT :R1 ABORT Break 1 CFFI[50]>
This breaks CFFI-SYS:INC-POINTER which ends up returning bogus pointers because the high 32 bits have been truncated.
James