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
Debugging C and OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-01 (15:19)
From: Mark Shinwell <mshinwell@j...>
Subject: Re: [Caml-list] Debugging C and OCaml
On Mon, Mar 01, 2010 at 10:10:44AM -0500, Jianzhou Zhao wrote:
> My main program is C++. It uses C functions to call
> OCaml functions, and these OCaml functions also call
> C functions and wrapped C++ functions sometimes.
> I can debug from C++, but it stops when it meets
> an OCaml binding. Does anyone know an efficient
> solution about how to debug across different languages?

Is this native code compilation?

If so, you should be able to use gdb to debug into the Caml bindings at the
assembly level -- does that work?  Unfortunately at the moment there is no Caml
compiler support for emitting the debug info required by gdb to debug at the
language level.  That said, ocamlopt-compiled assembly code is fairly easy to
read, and you should be able to get something resembling a backtrace using