[Openmcl-devel] Carbon FFI: How can I debug this?

David Steuber david at david-steuber.com
Fri Dec 24 22:40:44 UTC 2004


On Dec 24, 2004, at 3:17 PM, David Steuber wrote:

> Can anyone see anything obviously wrong with this code?
>
>       ;; Install event handler
>       (#_InstallEventHandler (#_GetWindowEventTarget *main-window*)
>                              (#_NewEventHandlerUPP 
> main-window-event-handler)
>                              1 mainspec
>                              *main-window*
>                              (ccl::%null-ptr))

GetWindowEventTarget was returning a NULL pointer causing 
InstallEventHandler to return paramErr.

(#_GetWindowEventTarget (ccl::%get-ptr *main-window*) turns out to be 
the correct incantation.  I don't know if I need to be using %GET-PTR 
for the user data parameter or not.

My app now gets killed when the callback is called, or so it appears.  
I'm really not sure how to debug that.  I figured out the last problem 
by using SETF, isolating bits of code, and using slime-connect to see 
what the return values were.  Tedious.  That option doesn't seem to be 
available for the callback dying.




More information about the Openmcl-devel mailing list