Sign inSign up

yhuai/c-summary-image

By yhuai

•Updated over 5 years ago

Docker image for https://github.com/SunghoLee/c-summary

Image
0

10K+

yhuai/c-summary-image repository overview

⁠Introduction to use c-summary via Docker image yhuai/c-summary-image

⁠Introduction

This image is built for c-summary⁠, a C Semantic Summary Extractor for JNI program analysis.

Thank to Sungho Lee for providing help for building this image!

⁠Prerequisite
  • Docker
⁠Instructions

To start the container, run

docker run --rm -it yhuai/c-summary-image

To capture C/C++ code via Infer, run

infer capture -- clang --include-directory /usr/lib/jvm/java-8-openjdk-amd64/include/ --include-directory /usr/lib/jvm/java-8-openjdk-amd64/include/linux/ -c #FILE_NAME_HERE

Please remember to substitute #FILE_NAME_HERE with actual file, for example, sample.c

Features provided by c-summary

  1. Pre-analysis to calculate alias relations

    infer analyze -P --pp-only
    
  2. Pre-analysis to construct a global environment

    infer analyze -P --ssp-only
    $INFER_HOME/src/_build/opt/GlobalCollector.exe
    
  3. Main-analysis to extract semantic summaries

    infer analyze -P --ss-only
    
  4. Post-analysis for global variables

   $INFER_HOME/src/_build/opt/PostGlobal.exe
  1. Transform sematic summary to Java methods

    $INFER_HOME/src/_build/default/JavaGenerator.exe
    
⁠Example

You can find a simple example at /home/sample, which includes a simple JNI program sample.c, and a bash script run.sh.

You can test c-summary by using the commands above, or you can use

sh run.sh

which executes these commands.

After execution, you should be able to find generated Java files at /home/sample/java-gen-out

Tag summary

Content type

Image

Digest

Size

3.1 GB

Last updated

over 5 years ago

docker pull yhuai/c-summary-image