Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 <> 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
> 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 Archives:
Bug reports: FAQ:
Beginner's list: