caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Julian Brown <brown@cs.bris.ac.uk>
To: caml-list@inria.fr
Subject: [Caml-list] Re: debugging a JIT compiler (from Ocaml bytecode to machine code [x86,etc...])
Date: Fri, 19 Mar 2004 15:08:22 +0000 (UTC)	[thread overview]
Message-ID: <slrnc5m376.5kt.brown@panic.cs.bris.ac.uk> (raw)
In-Reply-To: <20040319143838.GA5284@bourg.inria.fr>

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.

Cheers,

Julian

-------------------
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


  reply	other threads:[~2004-03-19 15:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-19 14:38 [Caml-list] " Basile Starynkevitch
2004-03-19 15:08 ` Julian Brown [this message]
2004-03-19 18:51 ` Richard Zidlicky
2004-03-19 19:51   ` Sven Luther
2004-03-20  2:10 ` Walid Taha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrnc5m376.5kt.brown@panic.cs.bris.ac.uk \
    --to=brown@cs.bris.ac.uk \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).