chubbymaggie / cil-mutate Goto Github PK
View Code? Open in Web Editor NEWThis project forked from eschulte/cil-mutate
Manipulate C Intermediate Language ASTs with CIL
License: GNU General Public License v3.0
This project forked from eschulte/cil-mutate
Manipulate C Intermediate Language ASTs with CIL
License: GNU General Public License v3.0
Manipulate C Intermediate Language ASTs with CIL This tool performs a number of operations on CIL ASTs parsed from C source files. ids | prints the total number of statements list | list each statement with its ID fulllist | show each statements with its ID show | show the numbered statement cut | cut the numbered statement trace | instrument to trace execution insert | copies the second numbered statement before the first swap | swaps the two numbered statements Installation The cil-mutate tool requires that CIL [1] be installed on your machine and able to be found by the ocamlfind utility. [1] http://kerneis.github.com/cil/ Examples $ cat etc/hello.c #include <stdio.h> int main(int argc, char *argv[]) { puts("hello"); return 0; } $ cil-mutate etc/hello.c extern int ( /* missing proto */ puts)() ; int main(int argc , char **argv ) { { puts("hello"); return (0); } } $ cil-mutate -ids etc/hello.c 2 $ cil-mutate -list etc/hello.c 1 Instr 2 Return $ cil-mutate -cut -stmt1 1 etc/hello.c extern int ( /* missing proto */ puts)() ; int main(int argc , char **argv ) { { { } return (0); } } $ cil-mutate -swap -stmt1 1 -stmt2 2 etc/hello.c extern int ( /* missing proto */ puts)() ; int main(int argc , char **argv ) { { return (0); puts("hello"); } } $ cil-mutate -trace etc/hello.c void *_coverage_fout ; extern int ( /* missing proto */ puts)() ; int main(int argc , char **argv ) { { if (_coverage_fout == 0) { _coverage_fout = fopen("trace", "wb"); } fprintf(_coverage_fout, "1\n"); fflush(_coverage_fout); puts("hello"); fprintf(_coverage_fout, "2\n"); fflush(_coverage_fout); return (0); } } $ cil-mutate -show -stmt1 1 etc/hello.c #line 4 "hello.c" puts("hello"); License Licensed under the GPLV3, see the COPYING file in this directory for more information.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.