caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Mark Shinwell" <mshinwell@janestreet.com>
To: Jianzhou Zhao <jianzhou@seas.upenn.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Debugging C and OCaml
Date: Mon, 1 Mar 2010 15:19:41 +0000	[thread overview]
Message-ID: <20100301151940.GD26002@janestreet.com> (raw)
In-Reply-To: <9dfe358d1003010710r69799c1duae37c42a3725b899@mail.gmail.com>

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
"where".

Mark


  reply	other threads:[~2010-03-01 15:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 15:10 Jianzhou Zhao
2010-03-01 15:19 ` Mark Shinwell [this message]
2010-03-01 19:24   ` [Caml-list] " rixed
2010-03-01 19:27     ` Mark Shinwell
2010-03-02  9:50       ` rixed
2010-03-02  0:48   ` Jianzhou Zhao
2010-03-02  0:52     ` Jianzhou Zhao
2010-03-02  7:36       ` Mark Shinwell
2010-03-02  7:42     ` Mark Shinwell

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=20100301151940.GD26002@janestreet.com \
    --to=mshinwell@janestreet.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jianzhou@seas.upenn.edu \
    /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).