Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Stop at exception
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Stop at exception
> I am debugging a large OCaml program and am stuck with an exception. The
> exception is thrown by a utility function that is invoked several times in
> the program. I want to know which invocation of the utility function
> throws the exception. I cannot keep a breakpoint inside the utility
> function because it is called several times in the program.
> 
> Is it possible to make the ocaml debugger stop at the invocation where the
> exception is being thrown?
> 
> Are there other ways to accomplish the above objective?

Easy: let the program run until it stops on the exception, then use the
"backstep" command to go back in time to the point where the exception
is raised; then do a "backtrace" command to see where you are.

In OCaml 3.04, you can also run the program outside of the debugger
and request a stack backtrace (set the OCAMLRUNPARAM environment
variable to "b").

- 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