Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <filliatr@csl.sri.com>
To: gerd@gerd-stolpmann.de
Cc: John Max Skaller <skaller@maxtal.com.au>,
	Patrick M Doane <patrick@watson.org>,
	Xavier Leroy <Xavier.Leroy@inria.fr>,
	Scott McPeak <smcpeak@cs.berkeley.edu>,
	caml-list@inria.fr
Subject: Re: how to set breakpoint at exception throw?
Date: Wed, 5 Jul 2000 15:13:13 -0700 (PDT)	[thread overview]
Message-ID: <14691.45817.315197.998898@cylinder.csl.sri.com> (raw)
In-Reply-To: <0007042058420E.14914@ice>


> In general, you are right; the  problem is that I do not have access
> to the location in the source code where the exception happened. I'm
> interested in  the line  number and the  file name of  the statement
> that originally caused the exception. Example:

It should  be easy to do  with camlp4, since locations  in sources are
bound in the right hand sides of grammar rules. Thus, you just have to
overwrite the syntax of raise so that it actually raises the exception
together with its location, in an exception looking like

  exception LocatedException of exn * (int * int);;

Then, when you want to debug  your program, you compile it with camlp4
and that little extension, instead of ocamlc.

I'm not expert enough  in the use of camlp4 to give  the code for this
extension (by the way, there is no quotation for raising exception, as
far as I looked in the manual) but I'm sure that's no more than two or
three lines of  code. And I don't know if the  current file name being
parsed can be accessed. Surely Daniel will be of some help here if you
ask him.

-- 
Jean-Christophe Filliatre    
  Computer Science Laboratory   Phone (650) 859-5173
  SRI International             FAX   (650) 859-2844
  333 Ravenswood Ave.           email filliatr@csl.sri.com
  Menlo Park, CA 94025, USA     web   http://www.csl.sri.com/~filliatr

  



  reply	other threads:[~2000-07-05 22:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-28 23:24 Scott McPeak
2000-06-30 13:08 ` Xavier Leroy
2000-07-01 12:57   ` Gerd Stolpmann
2000-07-03 15:05     ` Patrick M Doane
2000-07-03 21:43       ` Norman Ramsey
2000-07-06  3:05         ` Michael Hohn
2000-07-04 14:43       ` John Max Skaller
2000-07-04 18:19         ` Gerd Stolpmann
2000-07-05 22:13           ` Jean-Christophe Filliatre [this message]
2000-07-06  1:26           ` Max Skaller
2000-07-06 11:23           ` Daniel de Rauglaudre
2000-07-05  1:28   ` Scott McPeak
2000-07-05 21:29 Don Syme

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=14691.45817.315197.998898@cylinder.csl.sri.com \
    --to=filliatr@csl.sri.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=gerd@gerd-stolpmann.de \
    --cc=patrick@watson.org \
    --cc=skaller@maxtal.com.au \
    --cc=smcpeak@cs.berkeley.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