caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamldebug question
@ 2013-08-09 10:53 Matej Kosik
  2013-08-09 10:59 ` Daniel Bünzli
  0 siblings, 1 reply; 3+ messages in thread
From: Matej Kosik @ 2013-08-09 10:53 UTC (permalink / raw)
  To: caml-list

Hello,

Is there any convenient way how to tell ocamldebug which commands to execute at startup?
(like it is possible to do with ".gdbinit" file for "gdb"?)

It is not too bad to enter:

	break @ Main 1
	run

everytime, but if there is a way to automate that (or something more complex),
it could make things smoother.

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

* Re: [Caml-list] ocamldebug question
  2013-08-09 10:53 [Caml-list] ocamldebug question Matej Kosik
@ 2013-08-09 10:59 ` Daniel Bünzli
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Bünzli @ 2013-08-09 10:59 UTC (permalink / raw)
  To: Matej Kosik; +Cc: caml-list

Le vendredi, 9 août 2013 à 11:53, Matej Kosik a écrit :
> Hello,
>  
> Is there any convenient way how to tell ocamldebug which commands to execute at startup?
> (like it is possible to do with ".gdbinit" file for "gdb"?)
>  
> It is not too bad to enter:
>  
> break @ Main 1
> run
>  
> everytime, but if there is a way to automate that (or something more complex),
> it could make things smoother.


It seems the best you can do is reduce n commands to 1:

http://caml.inria.fr/pub/docs/manual-ocaml/manual030.html#toc131

Best,

Daniel



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

* [Caml-list] ocamldebug question
@ 2012-10-14 13:19 Matej Kosik
  0 siblings, 0 replies; 3+ messages in thread
From: Matej Kosik @ 2012-10-14 13:19 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

Hello,

I have decided to play a little with ocamldebug.
Stepping through programs that rely on the standard library works fine.
I can step into functions defined in stdlib and see the relevant source
code.

I am trying to figure out how to do similar thing with batteries.

This directory:

	/home/me/godi/lib/ocaml/pkg-lib/batteries

contains installed "batteries included" library.

This directory:

	/home/me/godi/build/distfiles/batteries-1.4.1/src

contains its source code.
(Where library was in

I have a small testing program like this:

  open Batteries_uni

  let v = Vect.of_list ["foo"; "bar"; "baz"]

  ;;

  Vect.iter print_string v;
  print_newline ();

I start the debugger:

  $ ocamldebug -I /home/me/godi/build/distfiles/batteries-1.4.1/src \
               -I /home/me/godi/lib/ocaml/pkg-lib/batteries \
               main

I set up a breakpoint at some convenient place:

  (ocd) break @ Main 1
  Loading program... done.
  Breakpoint 1 at 1129200 : file main.ml, line 3, characters 9-43

and try to go on:

  (ocd) run
  Time : 47989 - pc : 1129200 - module Main
  Breakpoint : 1
  3 let v = Vect.of_list ["foo"; "bar"; "baz"]<|a|>

Now, when I try to step into the Vect.of_list function:

  (ocd) step

I get a complaint:

  Time : 47990 - pc : 808516 - module BatVect
  No source file for BatVect.

I can continue with debugging, but I cannot display the corresponding
source-code.

Now, I am not sure what to do. Is there any way how can I use ocamldebug
and, when necessary, step also into modules bundled by batteries.cma?

I have attached listing of the contents of the two corresponding
directories.

Thanks in advance, for any [clues; hints; help].

[-- Attachment #2: listing.txt.gz --]
[-- Type: application/gzip, Size: 2734 bytes --]

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

end of thread, other threads:[~2013-08-09 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-09 10:53 [Caml-list] ocamldebug question Matej Kosik
2013-08-09 10:59 ` Daniel Bünzli
  -- strict thread matches above, loose matches on Subject: below --
2012-10-14 13:19 Matej Kosik

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