package bisect_ppx
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=bca41882f22b5345ef7786af366f0c2f9eebb924e2b658a89d19e57d33bd6bab
    
    
  md5=05d514706646adc947ed21e7e69a1cf1
    
    
  doc/bisect_ppx.runtime/Bisect/Common/index.html
Module Bisect.Common
This module provides type definitions, and functions used by the various parts of Bisect.
type point_definition = {- offset : int;(*- Point offset, relative to file beginning. *)
- identifier : int;(*- Point identifier, unique in file. *)
}The type of point definitions, that is places of interest in the source code.
Utility functions
try_finally x f h implements the try/finally logic. f is the body of the try clause, while h is the finally handler. Errors raised by handler are silently ignored.
val try_in_channel : bool -> string -> (in_channel -> 'a) -> 'atry_in_channel bin filename f is equivalent to try_finally x f h where:
- xis an input channel for file- filename(opened in binary mode iff- binis- true);
- hjust closes the input channel. Raises an exception if any error occurs.
val try_out_channel : bool -> string -> (out_channel -> 'a) -> 'atry_out_channel bin filename f is equivalent to try_finally x f h where:
- xis an output channel for file- filename(opened in binary mode iff- binis- true);
- hjust closes the output channel. Raises an exception if any error occurs.
I/O functions
Exception to be raised when a read file does not conform to the Bisect format. The parameter is the name of the incriminated file and the reason of the error.
Exception to be raised when a read file has a format whose version is unsupported. The parameter is the name of the incriminated file.
Exception to be raised when the source file has been modified since instrumentation. The parameter is the name of the incriminated file.
val write_runtime_data : 
  out_channel ->
  (string * (int array * string)) list ->
  unitwrite_runtime_data oc d writes the runtime data d to the output channel oc using the Bisect file format. The runtime data list d encodes a map (through an association list) from files to arrays of integers (the value at index i being the number of times point i has been visited). The arrays are paired with point definition lists, giving the location of each point in the file.
Raises Sys_error if an i/o error occurs.
val write_points : point_definition list -> stringwrite_points pts converts the point definitions pts to a string. The string is a binary byte sequence; it is not meant to be legible.
read_runtime_data f reads the runtime data from file f.
Raises Sys_error if an i/o error occurs. May also raise Invalid_file, Unsupported_version, or Modified_file.
val read_points' : string -> point_definition listread_points s reads point definitions from the string s.
val read_points : string -> point_definition list