Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Debugging problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: vinh le sy <vinhioi@y...>
Subject: Debugging problem
Hi all,
I am debugging using camldebugger. I got the same
problem as Robin posted few years ago. 
Here comes the problem:

Let's take a simple example (took from the manual):

(***** File *******)

class point =
      val mutable x = 0
      method get_x = x
      method move d = x <- x + d

let my_p = new point;;


In order to print the value x of my_p, I separately
defined a printer
function as

(***** File *******)

open Format

let my_print_point s =
   open_box 0;
   print_string ("The point is situated at" ^
string_of_int (s#get_x));
   print_space ();
   close_box ();
   print_newline ()

Here are the steps I followed:

1. Compile and
         ocamlc -c -g
         ocamlc -c -g

2. Create the executable file "essai"
         ocamlc -custom -g -o essai essai.cmo

3. Launch the debugger on the file "essai"

4. load the printer (I show also the answer of the
 (ocd) load_printer "essai_printer.cmo"
 File ./essai_printer.cmo loaded
 5. install the printer function my_print_point
 (ocd) install_printer Essai_printer.my_print_point
 6. ....put a breakpoint immediately after the
definition of my_p

7. print my_p
 (ocd) p my_p
 my_p : point = <cannot fetch remote object>

Do anyone know the solution for the problem?

Thank you,

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around