caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jan Kybic <kybic@fel.cvut.cz>
To: caml-list@inria.fr
Subject: Feature wish: Localization information for exceptions
Date: 08 Oct 2005 20:35:24 +0200	[thread overview]
Message-ID: <m24q7rluvn.fsf@fel.cvut.cz> (raw)

Hello,
        I have a wish: would it be possible to print some kind of localization
information when a native code Ocaml program is aborted due to
exceptions such as 'index out of bounds' or 'Stack overflow'?
When a program is aborted due to failed 'assert', this information is
printed, so I thought maybe it would not be so difficult to do it for other
exceptions too. At least knowing which function threw the exception would
be great.

Otherwise, localizing the cause of the error is quite time
consuming. I know there is a debugger for byte code programs which can
be used but for my applications (numerical calculations) the byte-code
programs are too slow. 

If I remember correctly there is a patch for the Ocaml compiler to
print the stack trace when program is aborted on exceptions. Are there
plans to include such a patch into the official compiler?

While I am at it, is there any chance of using native-code debugger
for Ocaml? That would be an equally acceptable solution.

For the moment, I am forced to instrument my program with frequent
debug prints so that I can localize the problem spot. And since I need
that these debug prints be completely removed for the production
version in order not to slow it down, I am surrounding each debug
print command with IFDEF DEBUG .. ELSE () ENDIF which is quite
cumbersome and obscures the code itself. Is there any other solution?


Thank you,

Jan

-- 
-------------------------------------------------------------------------
Jan Kybic <kybic@fel.cvut.cz>                       tel. +420 2 2435 5721
http://cmp.felk.cvut.cz/~kybic                      ICQ 200569450


             reply	other threads:[~2005-10-08 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-08 18:35 Jan Kybic [this message]
     [not found] ` <434A6E4C.1080008@gaillourdet.net>
2005-10-10 14:25   ` [Caml-list] " Jan Kybic

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=m24q7rluvn.fsf@fel.cvut.cz \
    --to=kybic@fel.cvut.cz \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).