caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] OCAMLRUNPARAM and backtraces
       [not found] <20010915004442.A10054@lakeland.eecs.harvard.edu>
@ 2001-09-15  5:10 ` Patrick M Doane
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick M Doane @ 2001-09-15  5:10 UTC (permalink / raw)
  To: Christian Lindig; +Cc: caml-list

I should have mentioned that I'm only trying this on bytecode. Here's
a concrete example:

except.ml:

  let f () = failwith "test"
  let main () = f ()
  ;;
  main ()


% ocamlc except.ml
% ./a.out 
Fatal error: uncaught exception Failure("test")
% setenv OCAMLRUNPARAM "b=1"
% ./a.out
Fatal error: uncaught exception Failure("test")
% 


On Sat, 15 Sep 2001, Christian Lindig wrote:

> >   % setenv OCAMLRUNPARAM "b=1"
> > 
> > but I've never seen a backtrace print out for uncaught exceptions. I
> > assume that others can get this working since I've seen outputs from it on
> > the list, so I must be missing something obvious. 
> 
> The environment variable looks ok. Stack traces only work with the
> byte code interpreter. You also must not catch the exception using 
> Printexec.to_string. Otherwise I have no idea. 
> 
> -- Christian

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] OCAMLRUNPARAM and backtraces
  2001-09-15  8:15 ` Xavier Leroy
@ 2001-09-15 21:16   ` Patrick M Doane
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick M Doane @ 2001-09-15 21:16 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

This made things work, thanks!

Would some modification to byterun/backtrace.c like this help for future
users?

  events = read_debug_info();
  if (events == Val_false) {
    if (backtrace_pos > 0) {
      fprintf(stderr, "No debug information - please recompile with -g
option\n");
    }
    return;
  }

Patrick


On Sat, 15 Sep 2001, Xavier Leroy wrote:

> > I'm wondering if anyone might have any ideas why setting OCAMLRUNPARAM to
> > include backtraces just doesn't work for me.
> 
> You need to compile and link with ocamlc -g, otherwise the bytecode
> executable doesn't contain the required source<->code correspondence
> information.
> 
> - Xavier Leroy
> 

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] OCAMLRUNPARAM and backtraces
  2001-09-15  3:42 Patrick M Doane
@ 2001-09-15  8:15 ` Xavier Leroy
  2001-09-15 21:16   ` Patrick M Doane
  0 siblings, 1 reply; 4+ messages in thread
From: Xavier Leroy @ 2001-09-15  8:15 UTC (permalink / raw)
  To: Patrick M Doane; +Cc: caml-list

> I'm wondering if anyone might have any ideas why setting OCAMLRUNPARAM to
> include backtraces just doesn't work for me.

You need to compile and link with ocamlc -g, otherwise the bytecode
executable doesn't contain the required source<->code correspondence
information.

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* [Caml-list] OCAMLRUNPARAM and backtraces
@ 2001-09-15  3:42 Patrick M Doane
  2001-09-15  8:15 ` Xavier Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick M Doane @ 2001-09-15  3:42 UTC (permalink / raw)
  To: caml-list

I'm wondering if anyone might have any ideas why setting OCAMLRUNPARAM to
include backtraces just doesn't work for me.

I'm running with Ocaml 3.02 using tcsh and FreeBSD.  On the command line,
I use:

  % setenv OCAMLRUNPARAM "b=1"

but I've never seen a backtrace print out for uncaught exceptions. I
assume that others can get this working since I've seen outputs from it on
the list, so I must be missing something obvious. 

Any thoughts?
Patrick

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-09-15 21:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010915004442.A10054@lakeland.eecs.harvard.edu>
2001-09-15  5:10 ` [Caml-list] OCAMLRUNPARAM and backtraces Patrick M Doane
2001-09-15  3:42 Patrick M Doane
2001-09-15  8:15 ` Xavier Leroy
2001-09-15 21:16   ` Patrick M Doane

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