caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Exception backtraces
@ 2007-01-23  2:54 Denis Bueno
  2007-01-24 21:53 ` [Caml-list] " Ingo Bormuth
  0 siblings, 1 reply; 7+ messages in thread
From: Denis Bueno @ 2007-01-23  2:54 UTC (permalink / raw)
  To: OCaml Mailing List

I found some > 6 year old threads on this list
(http://caml.inria.fr/pub/ml-archives/caml-list/2000/07/5a1aa1b9873679a2bf87fce5c55f342f.en.html)
having to do with the fact that you couldn't get backtraces on caught
exceptions without using camlp4.

Is this still the case?

I'm using a unit testing framework, and it catches thrown exceptions
and uses Printexc.print to print out the exception. However, this
omits the most useful piece of information: the source line that threw
the exception. Is there anyway to get there, short of setting
OCAMLRUNPARAM="b" and letting it propagate to the source level (or
using the debugger)?

Thanks in advance.

-Denis


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Exception backtraces
  2007-01-23  2:54 Exception backtraces Denis Bueno
@ 2007-01-24 21:53 ` Ingo Bormuth
  2007-01-25  2:32   ` Denis Bueno
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Bormuth @ 2007-01-24 21:53 UTC (permalink / raw)
  To: caml-list

On 2007-01-22 21:54, Denis Bueno wrote:
> I found some > 6 year old threads on this list
> (http://caml.inria.fr/pub/ml-archives/caml-list/2000/07/5a1aa1b9873679a2bf87fce5c55f342f.en.html)
> having to do with the fact that you couldn't get backtraces on caught
> exceptions without using camlp4.
> Is this still the case?

Taken from the latest Caml Weekly News, for the week of January 16 to 23, 2007 :

>> ========================================================================
>> 8) native-code stack backtraces
>> Archive: <http://groups.google.com/group/fa.caml/browse_frm/thread/
>> cdd54b032895c17f/9af1209426f60400#9af1209426f60400>
>> ------------------------------------------------------------------------
>> ** Xavier Leroy said:
>> 
>> Among the 150 messages that accumulated while I was at the POPL
>> conference, I notice that the topic of native-code exception
>> backtraces is making its come-back:
>> > Well, seeing that the very useful native exception backtrace patch
>> has
>> > been
>> > sitting idle (acknowledged) for more than a year, I think that's not
>> > working it out too well :\
>> 
>> Like elephants, I'm slow, but never forget :-)  You'll be pleased to
>> learn that I've been working recently on exception backtraces for
>> ocamlopt.  The code (nearly finished) currently sits in the
>> "opt_backtrace" branch of the repository and should be part of
>> release 3.10.
>> It implements an exception backtrace mechanism similar to that already
>> available in bytecode, but different from Markus Mottl's call backtrace.
>> The two kinds of backtraces are incomparable in general, but while
>> Markus's solution is quite low overhead already, mine has even lower
>> overhead, especially in terms of code size.
>> 
>> Native-code backtraces will be available initially for the following
>> back-ends: i386, amd64 and powerpc, both for Unix-like OS and for
>> Windows.  Ports to other back-ends will be considered if there is
>> sufficient demand.


--
Ingo Bormuth, voicebox & fax: +49-(0)-12125-10226517
public key 86326EC9, http://ibormuth.efil.de/contact


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Exception backtraces
  2007-01-24 21:53 ` [Caml-list] " Ingo Bormuth
@ 2007-01-25  2:32   ` Denis Bueno
  2007-01-25  2:47     ` Jon Harrop
  2007-01-25  3:31     ` Erik de Castro Lopo
  0 siblings, 2 replies; 7+ messages in thread
From: Denis Bueno @ 2007-01-25  2:32 UTC (permalink / raw)
  To: Ingo Bormuth; +Cc: caml-list

On 1/24/07, Ingo Bormuth <ibormuth@efil.de> wrote:
> On 2007-01-22 21:54, Denis Bueno wrote:
> > I found some > 6 year old threads on this list
> > (http://caml.inria.fr/pub/ml-archives/caml-list/2000/07/5a1aa1b9873679a2bf87fce5c55f342f.en.html)
> > having to do with the fact that you couldn't get backtraces on caught
> > exceptions without using camlp4.
> > Is this still the case?
>
> Taken from the latest Caml Weekly News, for the week of January 16 to 23, 2007 :
>
> >> ========================================================================
> >> 8) native-code stack backtraces
> >> Archive: <http://groups.google.com/group/fa.caml/browse_frm/thread/
> >> cdd54b032895c17f/9af1209426f60400#9af1209426f60400>
> >> ------------------------------------------------------------------------
> >> ** Xavier Leroy said:
[snip long post]

I did see that, but, since I'm compiling into bytecode (which,
granted, I did not specify), I didn't think it applied to me. In any
event, it doesn't specify how exactly to *get* backtraces (apart from
OCAMLPARAM="b") at all.

Is there a way?

-Denis


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Exception backtraces
  2007-01-25  2:32   ` Denis Bueno
@ 2007-01-25  2:47     ` Jon Harrop
  2007-01-25  4:57       ` Denis Bueno
  2007-01-25 22:37       ` Jan Rehders
  2007-01-25  3:31     ` Erik de Castro Lopo
  1 sibling, 2 replies; 7+ messages in thread
From: Jon Harrop @ 2007-01-25  2:47 UTC (permalink / raw)
  To: caml-list

On Thursday 25 January 2007 02:32, Denis Bueno wrote:
> I did see that, but, since I'm compiling into bytecode (which,
> granted, I did not specify), I didn't think it applied to me. In any
> event, it doesn't specify how exactly to *get* backtraces (apart from
> OCAMLPARAM="b")

Can you explain what you want that CAMLPARAM=b does not provide?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Exception backtraces
  2007-01-25  2:32   ` Denis Bueno
  2007-01-25  2:47     ` Jon Harrop
@ 2007-01-25  3:31     ` Erik de Castro Lopo
  1 sibling, 0 replies; 7+ messages in thread
From: Erik de Castro Lopo @ 2007-01-25  3:31 UTC (permalink / raw)
  To: caml-list

Denis Bueno wrote:

> I did see that, but, since I'm compiling into bytecode (which,
> granted, I did not specify), I didn't think it applied to me. In any
> event, it doesn't specify how exactly to *get* backtraces (apart from
> OCAMLPARAM="b") at all.
> 
> Is there a way?

I blogged about it here:

    http://www.mega-nerd.com/erikd/Blog/CodeHacking/Ocaml/exception_backtraces.html

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"A mouse is a device used to point at the xterm you want to type in."
-- Kim Alm, a.s.r 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Exception backtraces
  2007-01-25  2:47     ` Jon Harrop
@ 2007-01-25  4:57       ` Denis Bueno
  2007-01-25 22:37       ` Jan Rehders
  1 sibling, 0 replies; 7+ messages in thread
From: Denis Bueno @ 2007-01-25  4:57 UTC (permalink / raw)
  To: Jon Harrop, OCaml Mailing List

On 1/24/07, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Thursday 25 January 2007 02:32, Denis Bueno wrote:
> > I did see that, but, since I'm compiling into bytecode (which,
> > granted, I did not specify), I didn't think it applied to me. In any
> > event, it doesn't specify how exactly to *get* backtraces (apart from
> > OCAMLPARAM="b")
>
> Can you explain what you want that CAMLPARAM=b does not provide?

I want to *catch* the exception and print the relevant information. I
don't want to let it propagate to the toplevel.

-Denis


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Exception backtraces
  2007-01-25  2:47     ` Jon Harrop
  2007-01-25  4:57       ` Denis Bueno
@ 2007-01-25 22:37       ` Jan Rehders
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Rehders @ 2007-01-25 22:37 UTC (permalink / raw)
  To: caml-list

On 25. Jan 2007, at 03:47, Jon Harrop wrote:
> On Thursday 25 January 2007 02:32, Denis Bueno wrote:
>> I did see that, but, since I'm compiling into bytecode (which,
>> granted, I did not specify), I didn't think it applied to me. In any
>> event, it doesn't specify how exactly to *get* backtraces (apart from
>> OCAMLPARAM="b")
>
> Can you explain what you want that CAMLPARAM=b does not provide?

Is it possible to get backtraces for the toplevel? I've tried to do  
it similar to the solution for the ocaml bytecode compiler but had no  
luck

-- Jan R.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-25 22:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23  2:54 Exception backtraces Denis Bueno
2007-01-24 21:53 ` [Caml-list] " Ingo Bormuth
2007-01-25  2:32   ` Denis Bueno
2007-01-25  2:47     ` Jon Harrop
2007-01-25  4:57       ` Denis Bueno
2007-01-25 22:37       ` Jan Rehders
2007-01-25  3:31     ` Erik de Castro Lopo

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).