Ignore:
Timestamp:
Sep 22, 2008, 10:58:36 PM (11 years ago)
Author:
gb
Message:

Get a little closer to working on darwinx8632: objc-error-return
code is written, might even work. Still need varargs support,
and the IDE will likely exerise the FFI a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/objc-bridge/objc-support.lisp

    r10562 r10840  
    313313#+x8632-target
    314314(progn
     315
     316(defloadvar *x8632-objc-callback-error-return-trampoline*
     317    (let* ((code-bytes '(#x83 #xec #x10      ; subl $16,%esp
     318                         #x89 #x04 #x24      ; movl %eax,(%esp)
     319                         #x52                ; pushl %edx
     320                         #xff #xe1))         ; jmp *ecx
     321           (nbytes (length code-bytes))
     322           (ptr (%allocate-callback-pointer 16)))
     323      (dotimes (i nbytes ptr)
     324        (setf (%get-unsigned-byte ptr i) (pop code-bytes)))))
     325
    315326(defun objc-callback-error-return (condition return-value-pointer return-address-pointer)
    316   (declare (ignorable oondition return-value-pointer return-address-pointer))
    317   #||
    318327  (process-debug-condition *current-process* condition (%get-frame-ptr))
    319328  (let* ((addr (%reference-external-entry-point (load-time-value (external "__NSRaiseError")))))
    320     (setf (%get-unsigned-long ) )
    321   (setf (%get-ptr return-value-pointer 0) (ns-exception condition))
    322   ||#
     329    (setf (%get-unsigned-long return-value-pointer -12 ) addr))
     330  (setf (%get-ptr return-value-pointer -8) (ns-exception condition)
     331        (%get-ptr return-value-pointer -4) (%get-ptr return-address-pointer)
     332        (%get-ptr return-address-pointer) *x8632-objc-callback-error-return-trampoline*)
    323333  nil)
    324334)
Note: See TracChangeset for help on using the changeset viewer.