caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] <newbie> Debugging mixed ocaml-C code.
@ 2004-07-22 17:34 Corey O'Connor
  2004-07-26 20:08 ` Eric Stokes
  0 siblings, 1 reply; 2+ messages in thread
From: Corey O'Connor @ 2004-07-22 17:34 UTC (permalink / raw)
  To: caml-list

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?

Are there any caveats to using the interactive environment with mixed
Ocaml-C code?

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] <newbie> Debugging mixed ocaml-C code.
  2004-07-22 17:34 [Caml-list] <newbie> Debugging mixed ocaml-C code Corey O'Connor
@ 2004-07-26 20:08 ` Eric Stokes
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Stokes @ 2004-07-26 20:08 UTC (permalink / raw)
  To: Corey O'Connor; +Cc: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-26 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-22 17:34 [Caml-list] <newbie> Debugging mixed ocaml-C code Corey O'Connor
2004-07-26 20:08 ` Eric Stokes

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).