<?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/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"
  prev="2002/07/c4ed9b0c7dc99d865b61955ab3e43fc6"
  next="2002/07/1c3e421998b8c597856d6c991ff07910"
  prev-in-thread="2002/06/8f7b7678eb38aa920d69e7658f700c47"
  next-in-thread="2002/07/f843bde85ac00294553d21cff5a9f860"
  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; From: "Mattias Waldau" &lt;mattias.waldau@abc.se&gt;
&gt; Date: Sun, 30 Jun 2002 19:41:24 +0200
&gt; 
&gt; &gt; I'm just starting to use the ocaml debugger.  I notice that 
&gt; &gt; when doing a backtrace, the different stack frames are 
&gt; &gt; identified as character positions in the source code file, 
&gt; &gt; but no line numbers are given.  This is a pretty major 
&gt; &gt; annoyance.  However, when you go up and down the call stack, 
&gt; &gt; you get the line numbers.  Is there any way to put the line 
&gt; &gt; numbers in the backtrace as well?
&gt; 
&gt; no line numbers, this is a recurrent complaint :-)

Actually, it turns out to be trivial to add this feature to the debugger.
In the file debugger/show_information.ml, apply this patch:

25a26
&gt; open Source
72,73c73,78
&lt;   fprintf ppf "#%i  Pc : %i  %s char %i@."
&lt;          framenum event.ev_pos event.ev_module event.ev_char
---
&gt;   let first_char_of_line, line = 
&gt;     line_of_pos (get_buffer event.ev_module) event.ev_char in
&gt;   let char_on_line = event.ev_char - first_char_of_line in
&gt;   fprintf ppf "#%i  Pc : %i  %s line: %i char: %i@."
&gt;     framenum event.ev_pos event.ev_module 
&gt;       line char_on_line

Don't forget the "open Source" line, or you won't be able to access the
"line_of_pos" function.  Nothing like open source software ;-)

&gt; 
&gt; &gt; 
&gt; &gt; I also would like a way to stop execution at the point at 
&gt; &gt; which an exception was raised.  There was a bug in my code 
&gt; &gt; that raised an exception, and the debugger was not helpful in 
&gt; &gt; tracking it down.  The last location I could step through 
&gt; &gt; before the exception was raised bore no relation to where the 
&gt; &gt; bug was occurring.  I'm not really sure why this was the case.
&gt; &gt; 
&gt; 
&gt; it does stop at the point.
&gt; 
&gt; I normally do 'b' to backstep one step and then 'u' one or several times
&gt; to go up the stack trace.
&gt; 

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.  

Mike
-------------------
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>

