From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA16135; Tue, 2 Jul 2002 11:32:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA16580 for ; Tue, 2 Jul 2002 11:32:24 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g629WKP01996; Tue, 2 Jul 2002 11:32:20 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA16591; Tue, 2 Jul 2002 11:32:19 +0200 (MET DST) Date: Tue, 2 Jul 2002 11:32:19 +0200 From: Xavier Leroy To: Michael Vanier Cc: mattias.waldau@abc.se, caml-list@inria.fr Subject: Re: [Caml-list] debugger questions/feature requests Message-ID: <20020702113219.A15063@pauillac.inria.fr> References: <001101c2205d$627cab20$0900a8c0@gateway> <200207012240.g61Mett03200@orchestra.cs.caltech.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200207012240.g61Mett03200@orchestra.cs.caltech.edu>; from mvanier@cs.caltech.edu on Mon, Jul 01, 2002 at 03:40:55PM -0700 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > 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