<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/f843bde85ac00294553d21cff5a9f860"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-02T09:32:24"
  subject="Re: [Caml-list] debugger questions/feature requests"
  prev="2002/07/3548469fc917388fb577cdf8c057664a"
  next="2002/07/21b0e21b4ac0db4ec833fe28522ef6f2"
  prev-in-thread="2002/07/2cb08e86bf1b871c42fe256bea0346c3"
  prev-thread="2002/06/50bf476e96f83c1a09039d54e2b11424"
  next-thread="2002/06/856037a4946698af7fa79bcf82a43049"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] debugger questions/feature requests">
<msg 
  url="2002/06/a545216e545c24d6dd77ca80d998d71f"
  from="Michael Vanier &lt;mvanier@c...&gt;"
  author="Michael Vanier"
  date="2002-06-29T12:39:53"
  subject="[Caml-list] debugger questions/feature requests">
<msg 
  url="2002/06/8f7b7678eb38aa920d69e7658f700c47"
  from="Mattias Waldau &lt;mattias.waldau@a...&gt;"
  author="Mattias Waldau"
  date="2002-06-30T17:41:56"
  subject="RE: [Caml-list] debugger questions/feature requests">
<msg 
  url="2002/07/2cb08e86bf1b871c42fe256bea0346c3"
  from="Michael Vanier &lt;mvanier@c...&gt;"
  author="Michael Vanier"
  date="2002-07-02T08:43:21"
  subject="Re: [Caml-list] debugger questions/feature requests">
<msg 
  url="2002/07/f843bde85ac00294553d21cff5a9f860"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-02T09:32:24"
  subject="Re: [Caml-list] debugger questions/feature requests">
</msg>
</msg>
</msg>
</msg>
</thread>

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

</contents>

</message>

