Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Debugging problem
@ 2006-01-25 21:29 vinh le sy
  2006-01-26  0:54 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 2+ messages in thread
From: vinh le sy @ 2006-01-25 21:29 UTC (permalink / raw)
  To: caml-list

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 


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

end of thread, other threads:[~2006-01-26  0:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-25 21:29 Debugging problem vinh le sy
2006-01-26  0:54 ` [Caml-list] " Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox