caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Mattias Waldau" <mattias.waldau@abc.se>
To: "Chris Hecker" <checker@d6.com>, <caml-list@inria.fr>
Subject: RE: [Caml-list] debugger backtracking/checkpoints
Date: Sat, 10 Nov 2001 14:39:56 +0100	[thread overview]
Message-ID: <AAEBJHFJOIPMMIILCEPBGEFPDEAA.mattias.waldau@abc.se> (raw)
In-Reply-To: <Pine.BSF.4.30.0111071507340.34635-100000@arda.pair.com>

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


  parent reply	other threads:[~2001-11-10 13:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-07 19:19 [Caml-list] Re: Debuggers (was Jihad) Krishnaswami, Neel
2001-11-07 19:51 ` [Caml-list] Re: Debuggers Eric Newhuis
2001-11-07 20:12 ` [Caml-list] debugger backtracking/checkpoints Chris Hecker
2001-11-07 20:29   ` Pixel
2001-11-08 15:14   ` Thorsten Ohl
2001-11-08 18:04     ` Christophe Raffalli
2001-11-09  9:51       ` Jerome Vouillon
2001-11-10 13:39   ` Mattias Waldau [this message]
2001-11-10 14:41     ` Dmitry Bely
2001-11-12 18:37     ` Chris Hecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AAEBJHFJOIPMMIILCEPBGEFPDEAA.mattias.waldau@abc.se \
    --to=mattias.waldau@abc.se \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).