package frama-c
Platform dedicated to the analysis of source code written in C
Install
Dune Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
NNicolas Bellec
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
VVincent Botbol
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
RRemi Lazarini
-
TTristan Le Gall
-
JJean-Christophe Léchenet
-
MMatthieu Lemerre
-
DDara Ly
-
DDavid Maison
-
CClaude Marché
-
AAndré Maroneze
-
TThibault Martin
-
FFonenantsoa Maurica
-
MMelody Méaulle
-
BBenjamin Monate
-
YYannick Moy
-
PPierre Nigron
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
JJan Rochel
-
MMuriel Roger
-
JJulien Signoles
-
NNicolas Stouls
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
frama-c-29.0-Copper.tar.gz
sha256=d2fbb3b8d0ff83945872e9e6fa258e934a706360e698dae3b4d5f971addf7493
doc/src/frama-c-wp.core/MemDebug.ml.html
Source file MemDebug.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2024 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_datatype open Lang.F open Sigs (* ------------------------------------------------------------------------ *) (* ---- Pretty-printers ---- *) (* ------------------------------------------------------------------------ *) let pp_sequence pp_val fmt seq = Format.fprintf fmt "@[{pre=%a,@,post=%a}@]" pp_val seq.pre pp_val seq.post let pp_equation fmt = function | Set (lt, rt) -> Format.fprintf fmt "@[%a =@, %a@]" pp_term lt pp_term rt | Assert pred -> pp_pred fmt pred let pp_acs fmt = function | RW -> Format.pp_print_string fmt "RW" | RD -> Format.pp_print_string fmt "RD" | OBJ -> Format.pp_print_string fmt "OBJ" let pp_value pp_loc fmt = function | Val t -> pp_term fmt t | Loc l -> pp_loc fmt l let pp_rloc pp_loc fmt = function | Rloc(_obj,l) -> Format.fprintf fmt "[@{%a}@]" pp_loc l | Rrange(l,_obj,tmin,tmax) -> Format.fprintf fmt "@[%a+(%a..%a)@]" pp_loc l (Pretty_utils.pp_opt pp_term) tmin (Pretty_utils.pp_opt pp_term) tmax let pp_sloc pp_loc fmt = function | Sloc l -> Format.fprintf fmt "@[{%a}@]" pp_loc l | Sarray(l,_obj,size) -> Format.fprintf fmt "@[%a+(0..%d)@]" pp_loc l size | Srange(l,_obj,tmin,tmax) -> Format.fprintf fmt "@[%a+(%a..%a)@]" pp_loc l (Pretty_utils.pp_opt pp_term) tmin (Pretty_utils.pp_opt pp_term) tmax | Sdescr(xs,l,p) -> Format.fprintf fmt "@[{ %a @,| %a@,; %a }@]" pp_loc l (Pretty_utils.pp_list pp_var) xs pp_pred p (* ------------------------------------------------------------------------ *) (* ---- Debug Memory Model ---- *) (* ------------------------------------------------------------------------ *) let dkey_cons = Wp_parameters.register_category "memdebug:cons" let dkey_loc = Wp_parameters.register_category "memdebug:loc" let dkey_cast = Wp_parameters.register_category "memdebug:cast" let dkey_access = Wp_parameters.register_category "memdebug:access" let dkey_valid = Wp_parameters.register_category "memdebug:valid" let dkey_alias = Wp_parameters.register_category "memdebug:alias" let debug_cons = Wp_parameters.debug ~dkey:dkey_cons let debug_loc = Wp_parameters.debug ~dkey:dkey_loc let debug_cast = Wp_parameters.debug ~dkey:dkey_cast let debug_access = Wp_parameters.debug ~dkey:dkey_access let debug_valid = Wp_parameters.debug ~dkey:dkey_valid let debug_alias = Wp_parameters.debug ~dkey:dkey_alias module Make(M : Sigs.Model) = struct let datatype = "MemDebug." ^ M.datatype let configure = M.configure let hypotheses = M.hypotheses module Chunk = M.Chunk module Heap = M.Heap module Sigma = M.Sigma type loc = M.loc type chunk = M.chunk type sigma = M.sigma type segment = M.segment type state = M.state (* ---------------------------------------------------------------------- *) (* ---- Pretty-printing ---- *) (* ---------------------------------------------------------------------- *) let pretty = M.pretty let state = M.state let iter = M.iter let lookup = M.lookup let updates = M.updates let apply = M.apply let vars = M.vars let occurs = M.occurs (* ---------------------------------------------------------------------- *) (* ---- Constructors ----- *) (* ---------------------------------------------------------------------- *) let null = let l = M.null in debug_cons "null:@, %a" pretty l; M.null let literal ~eid cstr = let l = M.literal ~eid cstr in debug_cons "literal ~eid:%d ->@, %a" eid pretty l; l let cvar x = let l = M.cvar x in debug_cons "cvar %a ->@, %a" Varinfo.pretty x pretty l; l let pointer_loc e = let l = M.pointer_loc e in debug_cons "term2loc %a ->@, %a" pp_term e pretty l; l let pointer_val l = let e = M.pointer_val l in debug_cons "loc2term %a ->@, %a" pretty l pp_term e; e (* ---------------------------------------------------------------------- *) (* ---- Operations ---- *) (* ---------------------------------------------------------------------- *) let field l fd = let l' = M.field l fd in debug_loc "@[%a.%a ->@, %a@]" pretty l Fieldinfo.pretty fd pretty l'; l' let shift l obj e = let l' = M.shift l obj e in debug_loc "@[%a+%a ->@, %a@]" pretty l pp_term e pretty l'; l' let base_addr l = let l' = M.base_addr l in debug_loc "@[base_addr: %a -> %a@]" pretty l pretty l'; l' let block_length = M.block_length (* ---------------------------------------------------------------------- *) (* ---- Casting ----- *) (* ---------------------------------------------------------------------- *) let cast ty l = let l' = M.cast ty l in debug_cast "(%a)%a -> %a" Ctypes.pretty ty.post pretty l pretty l'; l' let loc_of_int obj e = let l = M.loc_of_int obj e in debug_cast "(%a)%a -> %a" Ctypes.pretty obj pp_term e pretty l; l let int_of_loc cint l = let e = M.int_of_loc cint l in debug_cast "(%a)%a -> %a" Ctypes.pp_int cint pretty l pp_term e; e (* ---------------------------------------------------------------------- *) (* ---- Domain ----- *) (* ---------------------------------------------------------------------- *) let domain = M.domain (* ---------------------------------------------------------------------- *) (* ---- Memory Access ----- *) (* ---------------------------------------------------------------------- *) let load s obj l = let v = M.load s obj l in debug_access "@[load %a @, %a @, %a ->@, %a@]@." Sigma.pretty s Ctypes.pretty obj pretty l (pp_value pretty) v; v let load_init _s _obj _l = e_false let stored seq obj l t = let preds = M.stored seq obj l t in debug_access "@[stored %a@, %a@, %a@, %a ->@, %a@]@." (pp_sequence Sigma.pretty) seq Ctypes.pretty obj pretty l pp_term t (Pretty_utils.pp_list pp_equation) preds; preds let stored_init _seq _obj _l _v = [] let copied seq obj ll rl = let preds = M.copied seq obj ll rl in debug_access "@[copied %a@, %a@, %a@, %a ->@, %a@]@." (pp_sequence Sigma.pretty) seq Ctypes.pretty obj pretty ll pretty rl (Pretty_utils.pp_list pp_equation) preds; preds let copied_init _seq _obj _ll _rl = [] let assigned seq obj sloc = let preds = M.assigned seq obj sloc in debug_access "@[assigned %a@, %a@, %a ->@, %a@]@." (pp_sequence Sigma.pretty) seq Ctypes.pretty obj (pp_sloc pretty) sloc (Pretty_utils.pp_list pp_equation) preds; preds (* ---------------------------------------------------------------------- *) (* ---- Pointer Comparison ----- *) (* ---------------------------------------------------------------------- *) let is_null = M.is_null let loc_eq = M.loc_eq let loc_lt = M.loc_lt let loc_leq = M.loc_leq let loc_neq = M.loc_neq let loc_diff = M.loc_diff (* ---------------------------------------------------------------------- *) (* ---- Validity ----- *) (* ---------------------------------------------------------------------- *) let valid s acs seg = let p = M.valid s acs seg in debug_valid "@[valid %a@, %a@, %a ->@, %a@]@." Sigma.pretty s pp_acs acs (pp_rloc pretty) seg pp_pred p; p let invalid s seg = let p = M.invalid s seg in debug_valid "@[invalid %a@, %a ->@, %a@]@." Sigma.pretty s (pp_rloc pretty) seg pp_pred p; p let scope = M.scope let global = M.global (* ---------------------------------------------------------------------- *) (* ---- Separation ----- *) (* ---------------------------------------------------------------------- *) let included seg1 seg2 = let p = M.included seg1 seg2 in debug_alias "@[included %a@, %a ->@, %a@]@." (pp_rloc pretty) seg1 (pp_rloc pretty) seg2 pp_pred p; p let separated seg1 seg2 = let p = M.separated seg1 seg2 in debug_alias "@[separated %a@, %a ->@, %a@]@." (pp_rloc pretty) seg1 (pp_rloc pretty) seg2 pp_pred p; p (** todo *) let initialized = M.initialized let alloc = M.alloc let frame = M.frame let is_well_formed = M.is_well_formed let base_offset = M.base_offset type domain = M.domain let configure_ia = M.configure_ia end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>