Version française
Home     About     Download     Resources     Contact us    
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 essai.ml *******)

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

let my_p = new point;;

(****************************)

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

(***** File essai_printer.ml *******)

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 essai.ml and essai_printer.ml
         ocamlc -c -g essai.ml
         ocamlc -c -g essai_printer.ml

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
debugger)
 (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,
VInh



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com