0

first of all, i will explain what i would like to do here : given a C big programm, i would like to output a list of producers/consumers for a data and a list of calling/called-by functions of the function where this data is.

for doing this, i am thinking about using what computes some modules of frama-c, like dataflow.ml or callgraph.ml in my own plugin.

however, as i read the plugin developper doc, i can't manage to see how we can have access to the data of those modules.

is a "open.cyl_type" sufficient here in my own plugin?

moreover, here are my other questions :

i tried using by the way pdg plugin for my purposes but when i call it and it says "pdg graph computed", how can i access it?

is there any more documented thing about "impact" plugin than the official webpage, in depth, how it works fondamentally? (i have to say that i'm in like a pre-project phase, and that i installed frama-c with the apt-get on ubuntu and that i did not get an impact plugin working (i'll see by compiling the sources))

by the way, do you think i'm using the right method to get to my purposes?

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
evoliptic
  • 333
  • 2
  • 11

2 Answers2

1

Your question is quite unclear, and this answer is thus very generic. As mentioned in the developer documentation, there are two main classes of plugins: static plugins, compiled with the kernel and whose API is exposed in a module (usually of the same name of the plugin) in Db. Dynamic plugins, such as Semantic_callgraph register dynamically their entry points through the Dynamic module.

If you do make doc in Frama-C sources (I'm not sure that there is a corresponding package in Ubuntu) you can access documentation for the Db module in FRAMAC_SOURCE_DIR/doc/code/html/Db.html and the list of functions registered by dynamic plugins in FRAMAC_SOURCE_DIR/doc/code/dynamic_plugins/Dynamic_plugins.html.

Virgile
  • 9,724
  • 18
  • 42
0

I think that, following Virgile's advice, you should get the source code anyway because you will most of the time need to browse the code to find what you are looking for. Beside, you can have a look at the hello_word plug-in (in src/dummy/hello_world) to have an example of a very simple plug-in. You can also find some examples on my web site at https://anne.pacalet.fr/Notes/doku.php?id=notes:0061_frama_c_scripts to find out how to have access to some information in the AST.

Anne
  • 1,270
  • 6
  • 15
  • @ Anne, @Virgile well, to be more precise, here are exemples of what i would like to do : in the reachingdefs.ml module, in commentaries, it says that "ReachingDef.stmtStartData" contains a mapping about reaching definitions after having called "computeRDs" on a fundec. So, how can i have access to this mapping in reachingdefs.stmtstartdata? an other exemple would be the callgraph.ml module. How to access to "cnCallees" and "cnCallers"? ps: sorry for the presentation i have to search how to make a "\n" here. – evoliptic Aug 21 '14 at 07:06
  • erf so sad i can't access your site from my job, moreover i tried to compile from source and i got the unbound module z error and i can't download packages from my job too... so is there any way to read the documentation done by make doc normally without that make? – evoliptic Aug 21 '14 at 08:05
  • well it seems that i have to do that make doc to get the references into frama-c-api.tar.gz and that then i will be able to do what i want... – evoliptic Aug 21 '14 at 09:24
  • @evoliptic try with http instead of https to reach my web site. – Anne Aug 21 '14 at 10:00
  • @evoliptic you should be able to use `cnCallees` and `cnCallers` : what is the problem ? But instead, I usually rather use `Kernel_function.find_syntactic_callsites`. – Anne Aug 21 '14 at 10:03
  • well i got to compile fram-c source, and as i have now the full API documentation, it's clear about what i can do. By the way, i would say my problem is solved. Nevertheless, i'm now following the tutorial in the development guide with the hello_world plugin, and at the Makefile step i get this error : file "./hello_world.cmx was not compiled with the 'for-pack Hello' option; have you any clue about it? – evoliptic Aug 21 '14 at 13:23
  • @Virgile, @ Anne thanks to you i'll come back if i have any problem – evoliptic Aug 21 '14 at 13:51