Loading ...
Sorry, an error occurred while loading the content.

ocamldebug question

Expand Messages
  • Jeffrey J. Cook
    I have found that debugging (rare, but it happens) in ocamldebug is very difficult if I do not create many explicit temporary variables, such as in the
    Message 1 of 2 , Oct 3, 2003
    • 0 Attachment
      I have found that debugging (rare, but it happens) in ocamldebug is very
      difficult if I do not create many explicit temporary variables, such as in
      the following code which pulls a structure out of a map, then does an
      immediate array lookup:

      let foo = (SomeMap.find "bob").somearray.(index) in

      I am unable to inspect the structure/array returned from the map find.
      Of course I could change the code to several lines with explicit variables:

      let struct = SomeMap.find "bob" in
      let foo = struct.somearray.(index) in


      This however leads to a significant code expansion, which for many cases
      is elegant enough to not warrant the expansion for clarity, not to meantion
      the need to be careful to always make values visible in the event I would
      need the value during debugging.

      Is there any other way to inspect the implicit values of expressions
      as they are being evaluated when stepping through the debugger?

      Thanks.

      --
      Jeffrey J. Cook
      Graduate Student, Electrical Engineering
      University of Illinois at Urbana-Champaign
      jjcook@...
    • Karl Zilles
      ... Hi Jeff, I ve just been playing around with the debugger for the first time, and I noticed this reference in the documentation:
      Message 2 of 2 , Oct 3, 2003
      • 0 Attachment
        Jeffrey J. Cook wrote:
        > Is there any other way to inspect the implicit values of expressions
        > as they are being evaluated when stepping through the debugger?

        Hi Jeff,

        I've just been playing around with the debugger for the first time, and
        I noticed this reference in the documentation:

        http://caml.inria.fr/ocaml/htmlman/manual030.html#htoc184

        * refers to the result just computed (typically, the value of a function
        application), and is valid only if the selected event is an ``after''
        event (typically, a function application).

        I haven't really tried it myself.

        Good Luck!
      Your message has been successfully submitted and would be delivered to recipients shortly.