Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: Michael Vanier <mvanier@cs.caltech.edu>
Cc: mattias.waldau@abc.se, caml-list@inria.fr
Subject: Re: [Caml-list] debugger questions/feature requests
Date: Tue, 2 Jul 2002 11:32:19 +0200	[thread overview]
Message-ID: <20020702113219.A15063@pauillac.inria.fr> (raw)
In-Reply-To: <200207012240.g61Mett03200@orchestra.cs.caltech.edu>; from mvanier@cs.caltech.edu on Mon, Jul 01, 2002 at 03:40:55PM -0700

> > I normally do 'b' to backstep one step and then 'u' one or several times
> > to go up the stack trace.
> > 
> 
> Hmm.  It doesn't work for me.  When I do this the last location I can see
> before hitting the exception is about two lines before the location of the
> bug.  I'm having a hard time wrapping my mind around the way the debugger
> works.  

Without seeing your code, I can only provide some general intuitions.
Briefly, the Caml debugger works just like popular debuggers for
conventional imperative language (C, Java, etc), with two exceptions:

- You get reverse execution in addition to forward execution,
e.g. while conventional debuggers offer (forward) single-stepping,
ocamldebug also offers back-stepping.

- Single-stepping in conventional debuggers stops at the beginning of
each statement, and at each function call.  Since Caml is an
expression-based language, statements don't play the central role that
they play in C or Java.  So, for Caml, single-stepping (and
back-stepping, and every other debugger command) stops at so-called
"debugging events", which are "interesting" locations in the program
source such as function entry, function application return, beginning
of loops, etc.  (See section 15.4.1 of the manual for a full listing.)  

So, if you bug occurs "between" two events, backstep takes you to the
immediately preceding event, which may be two lines before.

- Xavier Leroy
-------------------
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/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      reply	other threads:[~2002-07-02  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-29 10:42 Michael Vanier
2002-06-30 17:41 ` Mattias Waldau
2002-07-01 22:40   ` Michael Vanier
2002-07-02  9:32     ` Xavier Leroy [this message]

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=20020702113219.A15063@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mattias.waldau@abc.se \
    --cc=mvanier@cs.caltech.edu \
    /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