123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2024 *)(* 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). *)(* *)(**************************************************************************)modulePervasives_string=StringincludePlugin.Register(structletname="Markdown report"letshortname="mdr"lethelp="generates a report in markdown format"end)moduleGenerate=String(structletoption_name="-mdr-gen"letarg_name="kind"letdefault="none"lethelp="select the <kind> of report to generate among: \
none (default), md, draft and sarif"end)moduleOutput:Parameter_sig.Filepath=structincludeFilepath(structletoption_name="-mdr-out"letarg_name="f"letfile_kind="Report"letexistence=Fc_Filepath.Indifferentlethelp="sets the name of the output file to <f>. \
If <f> has no extension, it is chosen automatically based on \
the report kind"end)letget()=lets=get()inifPervasives_string.contains(Filename.basename(s:>string))'.'thenselseletkind=Generate.get()inletext=ifkind="sarif"then".sarif"else".md"inFc_Filepath.Normalized.concatsextendlet()=Generate.set_possible_values["none";"md";"draft";"sarif"]moduleRemarks=Filepath(structletoption_name="-mdr-remarks"letarg_name="f"letfile_kind="Remarks file"letexistence=Fc_Filepath.Must_existlethelp="reads file <f> to add additional remarks to various sections of the report. \
Must be in a format compatible with the file produced by -mdr-gen-draft. \
Remarks themselves must be written in pandoc's markdown, although this is \
not enforced by the plug-in"end)moduleFlameGraph=Empty_string(structletoption_name="-mdr-flamegraph"letarg_name="f"lethelp="reads file <f> to include a FlameGraph (https://github.com/brendangregg/FlameGraph.git),\
allowing the most analysis-intensive callstacks to be identified\
quickly and accurately"end)moduleAuthors=String_list(structletoption_name="-mdr-authors"letarg_name="l"lethelp="list of authors of the report"end)moduleTitle=Empty_string(structletoption_name="-mdr-title"letarg_name="t"lethelp="title of the generated document"end)moduleDate=Empty_string(structletoption_name="-mdr-date"letarg_name="d"lethelp="date of the report"end)moduleStubs=String_list(structletoption_name="-mdr-stubs"letarg_name="f1,...,fn"lethelp="list of C files containing stub functions"end)modulePrintLibc=True(structletoption_name="-mdr-print-libc"lethelp="when set (default), reports include information about libc elements."end)moduleSarifDeterministic=False(structletoption_name="-mdr-sarif-deterministic"lethelp="omits non-deterministic data from SARIF reports, such as \
absolute file URIs and timestamps."end)