Module Absint.Errlog

Module for error logs.

type node_tag =
  1. | Condition of bool
  2. | Exception of IR.Typ.name
  3. | Procedure_start of IR.Procname.t
  4. | Procedure_end of IR.Procname.t
type loc_trace_elem = private {
  1. lt_level : int;
    (*

    nesting level of procedure calls

    *)
  2. lt_loc : IBase.Location.t;
    (*

    source location at the current step in the trace

    *)
  3. lt_description : string;
    (*

    description of the current step in the trace

    *)
  4. lt_node_tags : node_tag list;
    (*

    tags describing the node at the current location

    *)
}

Element of a loc trace

val make_trace_element : int -> IBase.Location.t -> string -> node_tag list -> loc_trace_elem

build a loc_trace_elem from its constituents (unambiguously identified by their types).

type loc_trace = loc_trace_elem list

Trace of locations

val concat_traces : (string * loc_trace) list -> loc_trace
val compute_local_exception_line : loc_trace -> int option

Look at all the trace steps and find those that are arising any exception, then bind them to the closest step at level 0. This extra information adds value to the report itself, and may avoid digging into the trace to understand the cause of the report.

type node =
  1. | UnknownNode
  2. | FrontendNode of {
    1. node_key : IR.Procdesc.NodeKey.t;
    }
  3. | BackendNode of {
    1. node : IR.Procdesc.Node.t;
    }
type err_key = private {
  1. severity : IBase.IssueType.severity;
  2. issue_type : IBase.IssueType.t;
  3. err_desc : Localise.error_desc;
}
val compare_err_key : err_key -> err_key -> int
type err_data = private {
  1. node_id : int;
  2. node_key : IR.Procdesc.NodeKey.t option;
  3. session : int;
  4. loc : IBase.Location.t;
  5. loc_in_ml_source : IBase.Logging.ocaml_pos option;
  6. loc_trace : loc_trace;
  7. visibility : IBase.IssueType.visibility;
  8. access : string option;
  9. extras : ATDGenerated.Jsonbug_t.extra option;
}

Data associated to a specific error

val compare_err_data : err_data -> err_data -> int
type t

Type of the error log

val empty : unit -> t

Empty error log

type iter_fun = err_key -> err_data -> unit

type of the function to be passed to iter

val iter : iter_fun -> t -> unit

Apply f to nodes and error names

val fold : (err_key -> err_data -> 'a -> 'a) -> t -> 'a -> 'a
val pp_loc_trace : Stdlib.Format.formatter -> loc_trace -> unit
val pp_errors : Stdlib.Format.formatter -> t -> unit

Print errors from error log

val pp_warnings : Stdlib.Format.formatter -> t -> unit

Print warnings from error log

val pp_html : IBase.SourceFile.t -> IBase.DB.Results_dir.path -> Stdlib.Format.formatter -> t -> unit

Print an error log in html format

val update : t -> t -> unit

Update an old error log with a new one

val log_issue : ?severity_override:IBase.IssueType.severity -> t -> loc:IBase.Location.t -> node:node -> session:int -> ltr:loc_trace -> access:string option -> extras:ATDGenerated.Jsonbug_t.extra option -> IBase.Checker.t -> IssueToReport.t -> unit
val merge : into:t -> t -> [ `Modified | `Intact ]
val loc_trace_length : loc_trace -> int
val loc_trace_max_depth : loc_trace -> int