Download the Plugin Development Guide - Frama-C
Transcript
Contents Foreword 9 1 Introduction 11 1.1 About this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.2 Outline 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Tutorial 13 2.1 What a Plug-in Looks Like? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2 The Hello plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.1 A Simple Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2.2 Registering a Script as a Plug-in . . . . . . . . . . . . . . . . . . . . . 15 2.2.3 Displaying Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.4 Writing a Makele . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2.5 Adding Command Line Options . . . . . . . . . . . . . . . . . . . . . . 17 2.2.6 Testing your Plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2.7 Documenting your Source Code . . . . . . . . . . . . . . . . . . . . . . 19 The CFG plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.1 Visiting the AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.2 Interfacing with a kernel-integrated plug-in . . . . . . . . . . . . . . . 22 2.3.3 Extending the Frama-C GUI . . . . . . . . . . . . . . . . . . . . . . . 23 2.3.4 Plug-In registration and command line options 2.3.5 Splitting les and writing a Makele 2.3 . . . . . . . . . . . . . 24 . . . . . . . . . . . . . . . . . . . 25 2.3.6 Getting your Plug-in Usable by Others . . . . . . . . . . . . . . . . . . 28 2.3.7 Writing your Plug-in into the Journal . . . . . . . . . . . . . . . . . . 28 2.3.8 Writing a Congure Script . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.3.9 Getting your plug-in Usable in a Multi Projects Setting 28 . . . . . . . . 3 Software Architecture 33 3.1 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Cil: C Intermediate Language . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 33 35