Module Stack_backtraces (.ml)


module Stack_backtraces: sig .. end
A Chamo view to browse stack backtraces, in case of uncaught exception. The view reads the stack backtraces from a file. To automatically use this view, proceed as follows: suppose you redirect the output of your execution in a file foo.sbt, associate the stack_bactraces view factory to these files, in your ~/.cameleon2/chamo.view file, in the view_from_filename_patterns variable, by adding (".*\\.log$", stack_backtraces) to the list of associations.

Then, in chamo, when you a open a .sbt file, the new view is displayed with the list of traces showing where the uncaught exception appeared. Selecting a trace automatically opens the source file at the location of the exception (if the file can be found from where you launched chamo).

The view automatically checks every 2 seconds if the file was modified. If the file cannot be found, this delay is 5 seconds before the next check.

Simply put this piece of code in your ~/.cameleon2/chamo_init.ml file to use it.
Author(s): Maxence Guesdon
Version: 0.2
Cameleon.Stack_backtraces


val factory_name : string

type raise_kind =
| Raised
| Reraised
| Called
| Primitive

type trace = {
   raise_kind : raise_kind;
   file : string;
   line : int;
   chars : int * int;
}
val string_of_raise_kind : raise_kind -> string
val trace_of_line : string -> trace option
val trace_list_of_file : string -> string * trace list
class view : Ed_view.topwin -> string -> object .. end
val create_view : Ed_view.topwin -> string -> view
val open_file : Ed_view.topwin ->
'a -> ?attributes:'b -> string -> [> `New_view of Ed_view.gui_view ]
class factory : Ed_view.view_factory