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 WAA22922; Mon, 26 Jul 2004 22:09:06 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA22872 for ; Mon, 26 Jul 2004 22:09:05 +0200 (MET DST) Received: from plover.csun.edu (plover.csun.edu [130.166.1.24]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6QK93EV013868 for ; Mon, 26 Jul 2004 22:09:04 +0200 Received: from puffin.csun.edu (puffin.csun.edu [130.166.1.21]) by plover.csun.edu (MOS 3.4.7-GR) with ESMTP id BFS30808; Mon, 26 Jul 2004 13:08:56 -0700 (PDT) Received: from [130.166.10.118] (s010n118.csun.edu [130.166.10.118]) by puffin.csun.edu (MOS 3.4.7-GR) with ESMTP id CAN17169 (AUTH eric); Mon, 26 Jul 2004 13:08:54 -0700 (PDT) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <9E593D9A-DF3F-11D8-BF9D-000A95A1E69A@csun.edu> Content-Transfer-Encoding: 7bit Cc: caml-list@inria.fr From: Eric Stokes Subject: Re: [Caml-list] Debugging mixed ocaml-C code. Date: Mon, 26 Jul 2004 13:08:53 -0700 To: "Corey O'Connor" X-Mailer: Apple Mail (2.618) X-Junkmail-Status: score=0/50, host=puffin.csun.edu X-Miltered: at nez-perce with ID 410564DF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 newbie:01 debugging:01 ocaml-c:01 corey:99 ocamldebug:01 behave:01 ocaml-c:01 ocamldebug:01 gdb:01 breakpoint:01 valgrind:01 86.:01 caveats:01 glue:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Jul 22, 2004, at 10:34 AM, Corey O'Connor wrote: > I'm having some troubles wrapping my head around working with both C > and Ocaml code in the same project. If anybody could answer some > questions for me that'd be great. :-) > > How does ocamldebug behave with mixed ocaml-C code? Can I debug the C > code within ocamldebug? Or does the C code have to be debugged > separately from the OCaml code? gdb should work with C code linked with Ocaml, you should be able to set a breakpoint in a C function, and run the caml code which calls the function. I have also had good luck with valgrind if you're on x86. > > Are there any caveats to using the interactive environment with mixed > Ocaml-C code? > Not many. If your OS does not support dynamic linking, and/or you don't build your glue module as a dynamic library then you will need to make a new custom toplevel environment. ocamlmktop -custom .... Other than that, and the fact that C code is not type safe it is completely transparent. > Thanks! > -- > -Corey O'Connor > > ------------------- > 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 > ------------------- 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