Frama-C API - Self
include Frama_c_kernel.Plugin.General_services
include Frama_c_kernel.Plugin.S
include Frama_c_kernel.Log.Messages
category for debugging/verbose messages. Must be registered before any use. Each column in the string defines a sub-category, e.g. a:b:c defines a subcategory c of b, which is itself a subcategory of a. Enabling a category (via -plugin-msg-category) will enable all its subcategories.
val printf : ?level:int -> ?dkey:category -> ?current:bool -> ?source:Frama_c_kernel.Filepath.position -> ?append:(Stdlib.Format.formatter -> unit) -> ?header:(Stdlib.Format.formatter -> unit) -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'aOutputs the formatted message on stdout. Levels and key-categories are taken into account like event messages. The header formatted message is emitted as a regular result message.
val verify : bool -> ('a, bool) Frama_c_kernel.Log.pretty_aborterIf the first argument is true, return true and do nothing else, otherwise, send the message on the fatal channel and return false.
The intended usage is: assert (verify e "Bla...") ;.
val not_yet_implemented : ?current:bool -> ?source:Frama_c_kernel.Filepath.position -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'araises FeatureRequest but does not send any message. If the exception is not caught, Frama-C displays a feature-request message to the user.
deprecated s ~now f indicates that the use of f of name s is now deprecated. It should be replaced by now.
val with_result : (Frama_c_kernel.Log.event option -> 'b) -> ('a, 'b) Frama_c_kernel.Log.pretty_aborterwith_result f fmt calls f in the same condition as logwith.
val with_warning : (Frama_c_kernel.Log.event option -> 'b) -> ('a, 'b) Frama_c_kernel.Log.pretty_aborterwith_warning f fmt calls f in the same condition as logwith.
val with_error : (Frama_c_kernel.Log.event option -> 'b) -> ('a, 'b) Frama_c_kernel.Log.pretty_aborterwith_error f fmt calls f in the same condition as logwith.
val with_failure : (Frama_c_kernel.Log.event option -> 'b) -> ('a, 'b) Frama_c_kernel.Log.pretty_aborterwith_failure f fmt calls f in the same condition as logwith.
val log : ?kind:Frama_c_kernel.Log.kind -> ?verbose:int -> ?debug:int -> 'a Frama_c_kernel.Log.pretty_printerGeneric log routine. The default kind is Result. Use cases (with n,m > 0):
log ~verbose:n: emit the message only when verbosity level is at leastn.log ~debug:n: emit the message only when debugging level is at leastn.log ~verbose:n ~debug:m: any debugging or verbosity level is sufficient.
val logwith : (Frama_c_kernel.Log.event option -> 'b) -> ?wkey:warn_category -> ?emitwith:(Frama_c_kernel.Log.event -> unit) -> ?once:bool -> ('a, 'b) Frama_c_kernel.Log.pretty_aborterRecommended generic log routine using warn_category instead of kind. logwith continuation ?wkey fmt similar to warning ?wkey fmt and then calling the continuation. The optional continuation argument refers to the corresponding event. None is used iff no message is logged. In case the wkey is considered as a Failure, the continution is not called. This kind of message denotes a fatal error aborting Frama-C. Notice that the ~emitwith action is called iff a message is logged.
val register : Frama_c_kernel.Log.kind -> (Frama_c_kernel.Log.event -> unit) -> unitLocal registry for listeners.
Category management
val pp_category : Stdlib.Format.formatter -> category -> unitpretty-prints a category.
val dkey_name : category -> stringreturns the category name as a string.
val get_category : string -> category optionreturns the corresponding registered category or None if no such category exists.
val get_all_categories : unit -> category listreturns all registered categories.
val add_debug_keys : category -> unitadd_debug_keys s enables the emission of messages for the categories corresponding to s, including potential subcategories (e.g. a and a:b for string a:b). The string must have been registered beforehand.
val del_debug_keys : category -> unitadd_debug_keys s disables the emission of messages for the categories corresponding to s, including potential subcategories (e.g. a and a:b for string a:b). The string must have been registered beforehand.
val get_debug_keys : unit -> category listReturns currently active keys
val is_debug_key_enabled : category -> boolReturns true if the given category is currently active
val pp_warn_category : Stdlib.Format.formatter -> warn_category -> unitval wkey_name : warn_category -> stringreturns the warning category name as a string.
val get_warn_category : string -> warn_category optionval get_all_warn_categories : unit -> warn_category listval get_all_warn_categories_status : unit -> (warn_category * Frama_c_kernel.Log.warn_status) listval set_warn_status : warn_category -> Frama_c_kernel.Log.warn_status -> unitval get_warn_status : warn_category -> Frama_c_kernel.Log.warn_statusinclude Frama_c_kernel.Plugin.S_no_log
val add_group : ?memo:bool -> string -> Frama_c_kernel.Cmdline.Group.tCreate a new group inside the plug-in. The given string must be different of all the other group names of this plug-in if memo is false. If memo is true the function will either create a fresh group or return an existing group of the same name in the same plugin. memo defaults to false
module Verbose : Frama_c_kernel.Parameter_sig.Intmodule Debug : Frama_c_kernel.Parameter_sig.IntHandle the specific `lib' directory of the plug-in.
Handle the specific `share' directory of the plug-in.
Handle the specific `session' directory of the plug-in.
module Cache_dir () : Frama_c_kernel.Parameter_sig.User_dir_optHandle the specific `cache' directory of the plug-in.
module Config_dir () : Frama_c_kernel.Parameter_sig.User_dir_optHandle the specific `config' directory of the plug-in.
module State_dir () : Frama_c_kernel.Parameter_sig.User_dir_optHandle the specific `state' directory of the plug-in.
val help : Frama_c_kernel.Cmdline.Group.tThe group containing option -*-help.
val messages : Frama_c_kernel.Cmdline.Group.tThe group containing options -*-debug and -*-verbose.
val grp_debug : Frama_c_kernel.Cmdline.Group.tGroup containing debug options.
include Frama_c_kernel.Parameter_sig.Builder
module Bool (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Boolmodule WithOutput (_ : sig ... end) : Frama_c_kernel.Parameter_sig.With_outputmodule Int (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Intmodule Float (_ : sig ... end) : Frama_c_kernel.Parameter_sig.FloatParameter with an optional decimal point converted to an Ocaml float
module String (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Stringmodule Filepath (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Filepathmodule Make_site_dir (_ : Frama_c_kernel.Parameter_sig.Site_dir) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Site_dirBuilds a Site_dir from an existing one. The first parameter is the parent directory. The second gives the name of the directory to create.
module Make_user_dir (_ : Frama_c_kernel.Parameter_sig.User_dir) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.User_dirBuilds a User_dir from an existing one. The first parameter is the parent directory. The second gives the name of the directory to create.
module Make_user_dir_opt (_ : Frama_c_kernel.Parameter_sig.User_dir) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.User_dir_optBuilds a User_dir_opt from an existing User_dir. The first parameter is the parent directory. The second gives the name of the directory to create (also used to create the option name), a possible environment variable name and the help message for the option.
module Custom (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Custom with type t = V.tAllow using custom types as parameters.
module Enum (X : sig ... end) : Frama_c_kernel.Parameter_sig.S with type t = X.tA fixed set of possible values, represented by a type t, intended to be a variant with only a finite number of possible constructions. Note that t must be comparable with structural equality
module Make_set (E : Frama_c_kernel.Parameter_sig.Value_datatype_with_collections) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Set with type elt = E.t and type t = E.Set.tmodule Filled_string_set (_ : sig ... end) : Frama_c_kernel.Parameter_sig.String_setmodule Filepath_list (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Filepath_listmodule Value_int : Frama_c_kernel.Parameter_sig.Value_datatype with type t = intmodule Value_string : Frama_c_kernel.Parameter_sig.Value_datatype with type t = stringmodule Filepath_map (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Map with type key = Frama_c_kernel.Fclib.Filepath.t and type value = V.t and type t = V.t Frama_c_kernel.Fclib.Filepath.Map.tmodule Make_map (K : Frama_c_kernel.Parameter_sig.Value_datatype_with_collections) (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Map with type key = K.t and type value = V.t and type t = V.t K.Map.tParameter is a map where multibindings are **not** allowed.
module String_map (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Map with type key = string and type value = V.t and type t = V.t Frama_c_kernel.Datatype.String.Map.tmodule Kernel_function_map (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Map with type key = Frama_c_kernel.Cil_types.kernel_function and type value = V.t and type t = V.t Frama_c_kernel.Cil_datatype.Kf.Map.tAs for Kernel_function_set, by default keys can only be defined functions. Use Parameter_customize.argument_may_be_fundecl to also include pure prototypes.
module Make_multiple_map (K : Frama_c_kernel.Parameter_sig.Value_datatype_with_collections) (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Multiple_map with type key = K.t and type value = V.t and type t = V.t list K.Map.tParameter is a map where multibindings are allowed.
module String_multiple_map (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Multiple_map with type key = string and type value = V.t and type t = V.t list Frama_c_kernel.Datatype.String.Map.tmodule Kernel_function_multiple_map (V : Frama_c_kernel.Parameter_sig.Value_datatype) (_ : sig ... end) : Frama_c_kernel.Parameter_sig.Multiple_map with type key = Frama_c_kernel.Cil_types.kernel_function and type value = V.t and type t = V.t list Frama_c_kernel.Cil_datatype.Kf.Map.tAs for Kernel_function_set, by default keys can only be defined functions. Use Parameter_customize.argument_may_be_fundecl to also include pure prototypes.
val parameters : unit -> Frama_c_kernel.Typed_parameter.t listval proxy : Frama_c_kernel.State_builder.Proxy.tval state : Frama_c_kernel.State.tComputation state of the analysis.
module ComputationState : Frama_c_kernel.State_builder.Ref with type data = computation_stateThe current computation state of the analysis, updated by force_compute and states updates.
val dkey_initial_state : categoryDebug categories responsible for printing initial and final states of Value. Enabled by default, but can be disabled via the command-line: -value-msg-key="-initial_state,-final_state"
val dkey_final_states : categoryval dkey_summary : categoryDebug categories.
val register_category : help:string -> ?default:bool -> string -> categorySame as Log's register_category, but help is mandatory.
val dkey_pointer_comparison : categoryval dkey_cvalue_domain : categoryval dkey_iterator : categoryval dkey_widening : categoryval dkey_partition : categoryval dkey_split_return : categoryval dkey_precision_settings : categoryval dkey_callstacks : categoryval dkey_callstack_hash : categoryval dkey_include_string_literal : categoryWarning categories.
val register_warn_category : help:string -> ?default:Frama_c_kernel.Log.warn_status -> string -> warn_categorySame as Log's register_warn_category, but help is mandatory.
val wkey_alarm : warn_categoryval wkey_locals_escaping : warn_categoryval wkey_garbled_mix_write : warn_categoryval wkey_garbled_mix_assigns : warn_categoryval wkey_garbled_mix_summary : warn_categoryval wkey_builtins_missing_spec : warn_categoryval wkey_builtins_override : warn_categoryval wkey_libc_unsupported_spec : warn_categoryval wkey_loop_unroll_auto : warn_categoryval wkey_loop_unroll_partial : warn_categoryval wkey_missing_loop_unroll : warn_categoryval wkey_missing_loop_unroll_for : warn_categoryval wkey_signed_overflow : warn_categoryval wkey_invalid_assigns : warn_categoryval wkey_missing_assigns : warn_categoryval wkey_missing_assigns_result : warn_categoryval wkey_experimental : warn_categoryval wkey_unknown_size : warn_categoryval wkey_ensures_false : warn_categoryval wkey_watchpoint : warn_categoryval wkey_recursion : warn_categoryval wkey_acsl : warn_categoryval wkey_acsl_unsupported : warn_categoryLogging.
This modules adapt the interface of Log.Messages to be usable with Position.t.
If position is given, then message will be located at this position. Otherwise if current or source are given, then the current position tracked by the kernel or the given location will respectively be used. stacktrace optional parameter controls whether the call stack must be printed at the end of the message and always default to false.
See Log.Messages for documentation
type 'a pretty_printer = ?emitwith:(Frama_c_kernel.Log.event -> unit) -> ?once:bool -> ?pos:Position.t -> ?current:bool -> ?source:Frama_c_kernel.Fclib.Filepath.position -> ?stacktrace:bool -> ?append:(Stdlib.Format.formatter -> unit) -> ?echo:bool -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'atype ('a, 'b) pretty_aborter = ?pos:Position.t -> ?current:bool -> ?source:Frama_c_kernel.Fclib.Filepath.position -> ?stacktrace:bool -> ?append:(Stdlib.Format.formatter -> unit) -> ?echo:bool -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'aval result : ?level:int -> ?dkey:category -> 'a pretty_printerResults of analysis.
val feedback : ?ontty:Frama_c_kernel.Log.ontty -> ?level:int -> ?dkey:category -> 'a pretty_printerProgress and feedback.
val debug : ?level:int -> ?dkey:category -> 'a pretty_printerDebugging information.
val warning : ?wkey:warn_category -> 'a pretty_printerWarnings.
val alarm : 'a pretty_printerAlarm emitted by the analysis.
val error : 'a pretty_printerUser error.
val abort : ('a, 'b) pretty_aborterUser error stopping the plugin.
val failure : 'a pretty_printerInternal error of the plug-in.
val fatal : ('a, 'b) pretty_aborterInternal error stopping the plug-in.
