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
[Caml-list] debugging a JIT compiler (from Ocaml bytecode to machine code [x86,etc...])
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-03-19 (15:20)
From: Julian Brown <brown@c...>
Subject: [Caml-list] Re: debugging a JIT compiler (from Ocaml bytecode to machine code [x86,etc...])
On 2004-03-19, Basile Starynkevitch <basile.starynkevitch@inria.fr> wrote:
> Dear All,
> As you might have noticed on my home page below, I coded (in C, using
> the GNU lightning library) a JIT translator (or compiler) which
> interprets Ocaml bytecode by translating it to machine code, using the
> GNU lightning library. You'll need the latest CVS version of lightning
> from http://savannah.gnu.org/projects/lightning
> The intended use should be to replace ocaml's byterun/interp.c with my
> jitinterp.c and recompile all the runtime. Details are given in my
> homepage below. 
> **this program is coded but still buggy** so don't use it *yet*
> (except for helping me).
> Debugging such a machine code generating program is painful. All
> trivial tests (those under CVS in test/testinterp/) passes but a bug
> still remain, which causes a segmentation violation (later on... - not
> at the faulty JIT codepoint!).

Wow, sweet. That is an idea I thought of, just out of idle curiosity
really, but I don't have the time (or necessarily the ability!) to pull
it off successfully!

If you haven't already, you might like to try the same method that
Julian Seward used for Valgrind, which is just to stop after N blocks
(and revert to the regular bytecode interpreter, if that's possible). You
can then use a binary search to locate the block which is failing.

Also Valgrind itself might be useful, of course. It does work in the
presence of self-modifying code, IM(H)E.



To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners