English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Difficulty tracking Not_found uncaught exception from Labltk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-11-29 (20:08)
From: George Necula <necula@e...>
Subject: Difficulty tracking Not_found uncaught exception from Labltk


   If I bind a trivial action to the `FocusIn event of a canvas, I get
"Uncaught exception: Not_found" printed on the console and nothing else. The
code that I write is shown below:

    Tk.bind ~events:[`FocusIn] ~fields:[`MouseX]
      ~action:(fun _ -> ignore (E.log "got the focus\n"))

I was able to track this message to Protocol.protected_dispatch. I tried to
change this function to propagate the exception further so that the
top-level can print the backtrace. This did not work (the exception is still
intercepted by somebody else). I then tried to put a call to
call_print_exception_backtrace in the protected_dispatch function. This
printed a couple of "caller unknown" lines for the Hashtbl module (but with
a wrong line number?). 

 If I turn on Protocol.debug then all I see is "camlcb 29 0". Since I do not
see the << printed, this led me to believe that the problem is the
Hashtbl.find in Protocol.dispatch_callback. From there I was able to find my
problem: I was calling remove_callbacks afterwards. 

 Is there a better way to debug such intercepted exceptions? 

George Necula.