From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA21409; Fri, 19 Mar 2004 16:20:21 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA22363 for ; Fri, 19 Mar 2004 16:20:19 +0100 (MET) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2JFKIHd018474 for ; Fri, 19 Mar 2004 16:20:18 +0100 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1B4LnF-0008BY-00 for ; Fri, 19 Mar 2004 16:20:17 +0100 Received: from panic.cs.bris.ac.uk ([137.222.103.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Mar 2004 16:20:17 +0100 Received: from brown by panic.cs.bris.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Mar 2004 16:20:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Julian Brown 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) Organization: University of Bristol Message-ID: References: <20040319143838.GA5284@bourg.inria.fr> Reply-To: brown@cs.bris.ac.uk X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: panic.cs.bris.ac.uk User-Agent: slrn/0.9.8.0 (Linux) X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; debugging:01 2004:99 basile:01 basile:01 interprets:01 ocaml's:01 byterun:01 runtime:01 debugging:01 bug:01 valgrind:01 valgrind:01 compiler:01 compiler:01 interp:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 235 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 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