Frama-C API - Kernel_log
This modules creates Kernel Logs manually instead of using the one created via the Plugin modules. It is required for Cmdline which cannot depend on Plugin. It also includes all Kernel debug and warning keys. Unless you cannot depend on Frama-C's kernel, always prefere using Kernel instead of Kernel_log.
module Debug_level : Log.Levelmodule Verbose_level : Log.Levelinclude 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: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 result : ?level:int -> ?dkey:category -> 'a Log.pretty_printerResults of analysis. Default level is 1.
val feedback : ?ontty:Log.ontty -> ?level:int -> ?dkey:category -> 'a Log.pretty_printerProgress and feedback. Level is tested against the verbosity level.
val debug : ?level:int -> ?dkey:category -> 'a Log.pretty_printerDebugging information dedicated to Plugin developers. Default level is 1. The debugging key is used in message headers. See also set_debug_keys and set_debug_keyset.
val warning : ?wkey:warn_category -> 'a Log.pretty_printerHypothesis and restrictions.
val error : 'a Log.pretty_printeruser error: syntax/typing error, bad expected input, etc.
val abort : ('a, 'b) Log.pretty_aborteruser error stopping the plugin.
val failure : 'a Log.pretty_printerinternal error of the plug-in.
val fatal : ('a, 'b) Log.pretty_aborterinternal error of the plug-in.
val verify : bool -> ('a, bool) 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: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 : (Log.event option -> 'b) -> ('a, 'b) Log.pretty_aborterwith_result f fmt calls f in the same condition as logwith.
val with_warning : (Log.event option -> 'b) -> ('a, 'b) Log.pretty_aborterwith_warning f fmt calls f in the same condition as logwith.
val with_error : (Log.event option -> 'b) -> ('a, 'b) Log.pretty_aborterwith_error f fmt calls f in the same condition as logwith.
val with_failure : (Log.event option -> 'b) -> ('a, 'b) Log.pretty_aborterwith_failure f fmt calls f in the same condition as logwith.
val log : ?kind:Log.kind -> ?verbose:int -> ?debug:int -> 'a 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 : (Log.event option -> 'b) -> ?wkey:warn_category -> ?emitwith:(Log.event -> unit) -> ?once:bool -> ('a, 'b) 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.
Category management
val register_category : ?help:string -> ?default:bool -> string -> categoryregister a new debugging/verbose category. Note: to enable a category's messages by default, pass ~default:true or add it (e.g. via add_debug_keys) after registration.
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_help : category -> stringreturns the category help 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 register_warn_category : ?help:string -> ?default:Log.warn_status -> string -> warn_categoryval 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 * Log.warn_status) listval set_warn_status : warn_category -> Log.warn_status -> unitval get_warn_status : warn_category -> Log.warn_statusMessage and warning categories
Fclib dkeys
val dkey_task : categoryval dkey_hptmap : categoryval dkey_acsl_extension : categoryval dkey_alpha : categoryval dkey_alpha_undo : categoryval dkey_approximation : categoryval dkey_asm_contracts : categoryval dkey_ast : categoryval dkey_attrs : categoryDisplay debug information related to attributes in Frama-C.
val dkey_builtins : categoryval dkey_check : categoryval dkey_cil_builder : categoryval dkey_cmdline : categoryval dkey_constfold : categoryval dkey_comments : categoryval dkey_compilation_db : categoryval dkey_mopsa_db : categoryval dkey_mopsa_db_verbose : categoryval dkey_dataflow : categoryval dkey_dataflow_scc : categoryval dkey_dominators : categoryval dkey_dyncalls : categoryval dkey_dynlink : categoryval dkey_emitter : categoryval dkey_emitter_clear : categoryval dkey_exn_flow : categoryval dkey_file_transform : categoryval dkey_file_print_one : categoryval dkey_file_annot : categoryval dkey_file_source : categoryMessages related to operations on files during preprocessing/parsing.
val dkey_filter : categoryval dkey_inline : categoryval dkey_globals : categoryval dkey_kf_blocks : categoryval dkey_linker : categoryval dkey_linker_find : categoryval dkey_loops : categoryval dkey_pp : categoryval dkey_pp_logic : categoryval dkey_pretty_source : categoryval dkey_print_attrs : categoryval dkey_print_bitfields : categoryval dkey_print_builtins : categoryval dkey_print_logic_coercions : categoryval dkey_print_c_types : categoryval dkey_print_logic_types : categoryval dkey_print_imported_modules : categoryval dkey_print_sid : categoryval dkey_print_unspecified : categoryval dkey_print_vid : categoryval dkey_print_field_offsets : categoryval dkey_printer_too_early : categoryval dkey_prop_status : categoryval dkey_prop_status_emit : categoryval dkey_prop_status_merge : categoryval dkey_prop_status_graph : categoryval dkey_prop_status_reg : categoryval dkey_project : categoryval dkey_rmtmps : categoryval dkey_referenced : categoryval dkey_typing_global : categoryval dkey_typing_init : categoryval dkey_typing_chunk : categoryval dkey_typing_cast : categoryval dkey_typing_pragma : categoryval dkey_ulevel : categoryval dkey_visitor : categoryval dkey_variadic : categoryval wkey_annot_error : warn_categoryerror in annotation. If only a warning, annotation will just be ignored.
val wkey_plugin_not_loaded : warn_categoryWarning related to not loaded plugins.
val wkey_extension_unknown : warn_categoryWarning related to the use of an unregistered ACSL extension.
val wkey_ghost_already_ghost : warn_categoryghost element is qualified with \ghost while this is already the case by default
val wkey_ghost_bad_use : warn_categoryerror in ghost code
val wkey_acsl_float_compare : warn_categoryval wkey_large_array : warn_categoryval wkey_conditional_feature : warn_categoryparsing feature that is only supported in specific modes (e.g. C11, gcc, ...).
val wkey_drop_unused : warn_categoryval wkey_linker_weak : warn_categoryval wkey_implicit_conv_void_ptr : warn_categoryval wkey_implicit_int : warn_categoryval wkey_incompatible_types_call : warn_categoryval wkey_incompatible_pointer_types : warn_categoryval wkey_inconsistent_specifier : warn_categoryval wkey_int_conversion : warn_categoryval wkey_merge_conversion : warn_categoryval wkey_alignof_bitfield : warn_categoryval wkey_initializer_overrides : warn_categoryval wkey_cert_exp_46 : warn_categoryval wkey_cert_msc_37 : warn_categoryval wkey_cert_msc_38 : warn_categoryval wkey_cert_exp_10 : warn_categoryval wkey_check_volatile : warn_categoryval wkey_jcdb : warn_categoryval wkey_mopsa_db : warn_categoryval wkey_mopsa_db_missing_library : warn_categoryval wkey_mopsa_db_non_c : warn_categoryval wkey_implicit_function_declaration : warn_categoryval wkey_no_proto : warn_categoryval wkey_missing_spec : warn_categoryval wkey_multi_from : warn_categoryval wkey_decimal_float : warn_categoryval wkey_acsl_extension : warn_categoryval wkey_cmdline : warn_categoryCommand-line related warning, e.g. for invalid options given by the user
val wkey_audit : warn_categoryWarning related to options '-audit-*'.
val wkey_parser_unsupported : warn_categoryWarning related to unsupported parsing-related features.
val wkey_parser_unsupported_attributes : warn_categoryWarning related to unsupported attributes during parsing.
val wkey_parser_unsupported_pragma : warn_categoryWarning related to unsupported _Pragma's during parsing.
val wkey_asm : warn_categoryWarnings related to assembly code.
val wkey_unnamed_typedef : warn_categoryWarning related to "unnamed typedef that does not introduce a struct or enumeration type".
val wkey_file_not_found : warn_categoryWarnings related to missing files during preprocessing/parsing.
val wkey_c11 : warn_categoryWarnings related to usage of C11-specific constructions.
val wkey_line_directive : warn_categoryWarnings related to unknown line directives.
val wkey_attrs : warn_categoryWarning related to the handling of attributes in Frama-C.
val wkey_unknown_attribute : warn_categoryWarning emitted when an unknown attribute is encountered during parsing.
val wkey_long_double : warn_categoryWarning emitted by plugins that do not support the long double format.
val wkey_format : warn_categoryval wkey_libc : warn_categoryval wkey_libc_framac : warn_categoryval wkey_prototype : warn_categoryval wkey_typing : warn_categoryval wkey_variadic_format_nonliteral : warn_categoryval wkey_transient : warn_categoryval wkey_inline : warn_categoryval wkey_project : warn_category