Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Olabldebug on classes?
@ 1999-02-22  6:54 John Whitley
  1999-02-22 15:28 ` Jerome Vouillon
  0 siblings, 1 reply; 2+ messages in thread
From: John Whitley @ 1999-02-22  6:54 UTC (permalink / raw)
  To: caml-list


Hello all,

Perhaps I am simply being a bit slow today, but I cannot seem to get
olabldebug to print/display class instance variables, mutable or
otherwise.

Consider the code example below.  When the debugger is stopped at
method bal, the commands "print bar" and "print baz" only produce the
"Unbound identifier" error message.  I can print parameters to invoked 
methods, but that's about it.

So how does one apply the debugger to classes?

Thanks much,
John

--cut here--------------------------------------
(* test main file *)

class foo n =
object
  val bar = n
  val mutable baz = 1
  method bal = baz <- baz*bar
end

let test = new foo 2

let _ =
  for i = 1 to 20 do
    test#bal
  done

--cut here--------------------------------------




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

* Re: Olabldebug on classes?
  1999-02-22  6:54 Olabldebug on classes? John Whitley
@ 1999-02-22 15:28 ` Jerome Vouillon
  0 siblings, 0 replies; 2+ messages in thread
From: Jerome Vouillon @ 1999-02-22 15:28 UTC (permalink / raw)
  To: John Whitley, caml-list


Hello,

> Perhaps I am simply being a bit slow today, but I cannot seem to get
> olabldebug to print/display class instance variables, mutable or
> otherwise.

This is a bug of the debugger (it has not been kept up to date with
respect to the compiler). The following patch fixes this problem.

-- Jérôme

Index: debugger/eval.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/debugger/eval.ml,v
retrieving revision 1.20
diff -u -r1.20 eval.ml
--- eval.ml     1998/08/03 13:51:08     1.20
+++ eval.ml     1999/02/22 15:20:24
@@ -71,8 +71,10 @@
       begin try
         let (p, valdesc) = Env.lookup_value lid env in
         (begin match valdesc.val_kind with
-           Val_ivar _ ->
-             let (p0, _) = Env.lookup_value (Longident.Lident "*self*") env in
+           Val_ivar (_, cl_num) ->
+             let (p0, _) =
+               Env.lookup_value (Longident.Lident ("self-" ^ cl_num)) env
+             in
              let v = path event p0 in
              let i = path event p in
              Debugcom.Remote_value.field v (Debugcom.Remote_value.obj i)




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

end of thread, other threads:[~1999-02-22 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-22  6:54 Olabldebug on classes? John Whitley
1999-02-22 15:28 ` Jerome Vouillon

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