caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* backtrace output: feature request
@ 2007-04-18 16:03 Sam Steingold
  2007-04-22 10:10 ` [Caml-list] " Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Steingold @ 2007-04-18 16:03 UTC (permalink / raw)
  To: caml-list

it appears that starting with 3.10 stack traces for natively compiled 
executables will be available. thanks!
one thing that I would love to see is being able to redirect this output:

try Result (foo ())
with e ->
   fprintf logstream "error: %s" (error_to_string e);
   stack_trace logstream;
   Error e

so that I can log both errors and their stack traces in a file for later 
examination, but still continue running.

Thanks.

Sam.


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

* Re: [Caml-list] backtrace output: feature request
  2007-04-18 16:03 backtrace output: feature request Sam Steingold
@ 2007-04-22 10:10 ` Xavier Leroy
  2007-04-22 14:35   ` Sam Steingold
  0 siblings, 1 reply; 3+ messages in thread
From: Xavier Leroy @ 2007-04-22 10:10 UTC (permalink / raw)
  To: Sam Steingold; +Cc: caml-list

> it appears that starting with 3.10 stack traces for natively compiled
> executables will be available. thanks!
> one thing that I would love to see is being able to redirect this output:
> so that I can log both errors and their stack traces in a file for later
> examination, but still continue running.

I agree it would be nice, and this feature is on my "to do" list.  It
takes a bit of work to make the backtrace data available from Caml, though,
so don't expect this for 3.10.

> how do I get backtraces on exceptions in then top-level?
> I want to see something like:
> h called g on line 1
> g called f on line 1
> f raised invalid_argument on line 1

Currently, you cannot.  Conceivably, this would be the same mechanism
as outlined above (i.e. making backtrace data available from Caml).
However, you'd get a backtrace in terms of file names and line
numbers, which don't make that much sense for toplevel definitions.
Functions names don't really exist in compiled code.

- Xavier Leroy


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

* Re: [Caml-list] backtrace output: feature request
  2007-04-22 10:10 ` [Caml-list] " Xavier Leroy
@ 2007-04-22 14:35   ` Sam Steingold
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Steingold @ 2007-04-22 14:35 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

> * Xavier Leroy <Knivre.Yrebl@vaevn.se> [2007-04-22 12:10:57 +0200]:
>
>> how do I get backtraces on exceptions in then top-level?
>> I want to see something like:
>> h called g on line 1
>> g called f on line 1
>> f raised invalid_argument on line 1
>
> Currently, you cannot.  Conceivably, this would be the same mechanism
> as outlined above (i.e. making backtrace data available from Caml).
> However, you'd get a backtrace in terms of file names and line
> numbers, which don't make that much sense for toplevel definitions.

yes they do. file=function name.

> Functions names don't really exist in compiled code.

sure - but file/line annotations do, and they can be easily augmented
with function names.

-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 6 (Zod)
http://truepeace.org http://jihadwatch.org http://pmw.org.il
http://openvotingconsortium.org http://iris.org.il http://dhimmi.com
Stupidity, like virtue, is its own reward.


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

end of thread, other threads:[~2007-04-22 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-18 16:03 backtrace output: feature request Sam Steingold
2007-04-22 10:10 ` [Caml-list] " Xavier Leroy
2007-04-22 14:35   ` Sam Steingold

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