123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* 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). *)(* *)(**************************************************************************)letname="callgraph"includePlugin.Register(structletname=nameletshortname="cg"lethelp="automatically compute the callgraph of the program. \
Using Eva might improve the precision of this plug-in"end)moduleFilename=Filepath(structletoption_name="-cg"letarg_name="filename"letfile_kind="DOT"letexistence=Fc_Filepath.Indifferentlethelp="dump the callgraph to the file \
<filename> in dot format"end)moduleServices=True(structletoption_name="-cg-services"lethelp="compute and display services (groups of related \
functions which seem to provide common functionalities) \
from the callgraph"end)moduleRoots=Kernel_function_set(structletoption_name="-cg-roots"letarg_name=""lethelp="if not empty, display only the functions of the callgraph \
reachable from the given functions"end)moduleService_roots=Kernel_function_set(structletoption_name="-cg-service-roots"letarg_name=""lethelp="when computing callgraph services (see "^Services.option_name^"), use the given functions (and their immediate children) \
as service roots. If none, use the main function if any; \
else use every uncalled function"end)moduleFunction_pointers=True(structletoption_name="-cg-function-pointers"lethelp="when Eva has not been computed, safely over-approximate \
callees in presence of function pointers; \
always done when Eva has been previously computed."end)moduleUncalled=True(structletoption_name="-cg-uncalled"lethelp="add the uncalled functions to the callgraph \
(the main function is always added anyway)"end)moduleUncalled_leaf=False(structletoption_name="-cg-uncalled-leaf"lethelp="add to the callgraph the uncalled functions that, \
themselves, do not call any function"end)letdumpoutputg=letfile=Filename.get()infeedback~level:2"dumping the graph into file %a"Fc_Filepath.Normalized.prettyfile;tryletcout=open_out(file:>string)inoutputcoutg;close_outcoutwithe->error"error while dumping the syntactic callgraph: %s"(Printexc.to_stringe)(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)