Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] <newbie> Debugging mixed ocaml-C code.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eric Stokes <eric.stokes@c...>
Subject: Re: [Caml-list] <newbie> Debugging mixed ocaml-C code.
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