Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Re: Debuggers (was Jihad)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mattias Waldau <mattias.waldau@a...>
Subject: RE: [Caml-list] debugger backtracking/checkpoints
I use a debugger at least once a day. I cannot understand people who put
print-statements into their programs to find bugs (JSP-people still do it
this way).

The problem I normally have with a debugger is go find the location
where the problem is. Setting a breakpoint isn't a good option, since
normally it is difficult to find the location. (If this is the only option,
very often you have to set breakpoints earlier and earlier until you are
ahead of the bug, so that you can step and see whats happening.)

The reversible debugger solves all these problems. Normally, my bugs results
in an assert-exception, so I just run under ocamldebug, and step backwards
over the buggy code until I found the error.

Essentially this means that even in bigger programs I find the bug and
fix it within a couple of minutes.

Debugging using the toplevel doesn't work for me. My programs are too big,
and it is hard to run internal parts standalone. It works for finding
bugs in libraries and similar.

So my guidelines for a developer using Ocaml is to
- use assert a lot so that you detect errors
- find the bugs by running until you get the assert-exception and
  step backwards.

The debugging feature I am missing in Ocaml is
- easy way of showing all the variables in the stack frame


/mattias

P.s. I still cannot use ocamldebug under emacs (M-x camldebug)
on Windows 2000/XP. I get 'Unknown option -emacs.'.
I have to run it in the shell.
Does it work for everyone else?

> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr
> [mailto:owner-caml-list@pauillac.inria.fr]On Behalf Of Chris Hecker
> Sent: Wednesday, November 07, 2001 9:12 PM
> To: caml-list@inria.fr
> Subject: [Caml-list] debugger backtracking/checkpoints
>
>
>
> > but disagree with the claim itself. Ocaml's debugger is in one respect
> > extremely advanced: it is a reversible debugger, which puts it way ahead
> > of most languages' debuggers, imperative or not. It is in one other
>
> Since the debugger doesn't work on msvc builds, I haven't used it
> much, but do people find the backtracking thing useful in everyday
> debugging?
>
> Chris
>
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ:
> http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives:
> http://caml.inria.fr

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr