Module for error logs.
type node_tag
=
| Condition of bool |
| Exception of InferIR.Typ.name |
| Procedure_start of InferIR.Typ.Procname.t |
| Procedure_end of InferIR.Typ.Procname.t |
type loc_trace_elem
= private
{
lt_level : int; | (** nesting level of procedure calls *) |
lt_loc : InferBase.Location.t; | (** source location at the current step in the trace *) |
lt_description : string; | (** description of the current step in the trace *) |
lt_node_tags : node_tag list; | (** tags describing the node at the current location *) |
}
Element of a loc trace
val make_trace_element : int ‑> InferBase.Location.t ‑> string ‑> node_tag list ‑> loc_trace_elem
build a loc_trace_elem from its constituents (unambiguously identified by their types).
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 err_key
= private
{
err_kind : InferIR.Exceptions.err_kind; |
in_footprint : bool; |
err_name : InferBase.IssueType.t; |
err_desc : InferIR.Localise.error_desc; |
severity : string; |
}
type err_data
= private
{
node_id_key : node_id_key; | |
session : int; | |
loc : InferBase.Location.t; | |
loc_in_ml_source : InferBase.Logging.ocaml_pos option; | |
loc_trace : loc_trace; | |
err_class : InferIR.Exceptions.err_class; | |
visibility : InferIR.Exceptions.visibility; | |
linters_def_file : string option; | |
doc_url : string option; | (** url to documentation of the issue type *) |
access : string option; |
}
Data associated to a specific error
val pp_loc_trace_elem : Format.formatter ‑> loc_trace_elem ‑> unit
val pp_loc_trace : Format.formatter ‑> loc_trace ‑> unit
val pp_html : InferBase.SourceFile.t ‑> InferBase.DB.Results_dir.path ‑> Format.formatter ‑> t ‑> unit
Print an error log in html format
val size : (InferIR.Exceptions.err_kind ‑> bool ‑> bool) ‑> t ‑> int
Return the number of elements in the error log which satisfy the filter.
val log_issue : InferIR.Typ.Procname.t ‑> ?clang_method_kind:string ‑> InferIR.Exceptions.err_kind ‑> t ‑> InferBase.Location.t ‑> (int * InferStdlib.IStd.Caml.Digest.t) ‑> int ‑> loc_trace ‑> ?linters_def_file:string ‑> ?doc_url:string ‑> ?access:string ‑> exn ‑> unit