Building and inspecting CFGs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Building and inspecting CFGs

Vassil Vassilev via cfe-dev
Hi everyone,

I am trying to build a C static analysis tool and in order to make some procedures I need to build Control Flow Graphs. I am using clang for parsing the c files and building the AST, in particular I am working with python bindings. I was wondering if there is any way to build and interact with a Control Flow Graph in the same way I can do it throught the AST with pyhton bindings. 
I inspected the files and I realized that with python bindings this is not possible (maybe I am wrong since I am a little newbie). Maybe exist another way to do it, can you help me with that? 

Thank you so much, I hope this is the right place for this type of questions.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building and inspecting CFGs

Vassil Vassilev via cfe-dev
Hello,

In Clang tools, you can use CFG class (search for CFG.cpp, CFG.h). However, I'm not sure if it is available with Python bindings.


23.05.2016 22:28, shr dev via cfe-dev пишет:
Hi everyone,

I am trying to build a C static analysis tool and in order to make some procedures I need to build Control Flow Graphs. I am using clang for parsing the c files and building the AST, in particular I am working with python bindings. I was wondering if there is any way to build and interact with a Control Flow Graph in the same way I can do it throught the AST with pyhton bindings. 
I inspected the files and I realized that with python bindings this is not possible (maybe I am wrong since I am a little newbie). Maybe exist another way to do it, can you help me with that? 

Thank you so much, I hope this is the right place for this type of questions.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building and inspecting CFGs

Vassil Vassilev via cfe-dev


On 5/24/16 3:33 PM, Alexey Sidorin via cfe-dev wrote:

> Hello,
>
> In Clang tools, you can use CFG class (search for CFG.cpp, CFG.h).
> However, I'm not sure if it is available with Python bindings.
>
>
> 23.05.2016 22:28, shr dev via cfe-dev пишет:
>> Hi everyone,
>>
>> I am trying to build a C static analysis tool and in order to make
>> some procedures I need to build Control Flow Graphs. I am using clang

There's already a bunch of infrastructure in place for this... are you
sure you want to start from scratch? (It uses the CFG infra that Alexey
mentioned).

http://clang-analyzer.llvm.org/


Jon

>> for parsing the c files and building the AST, in particular I am
>> working with python bindings. I was wondering if there is any way to
>> build and interact with a Control Flow Graph in the same way I can do
>> it throught the AST with pyhton bindings.
>> I inspected the files and I realized that with python bindings this is
>> not possible (maybe I am wrong since I am a little newbie). Maybe
>> exist another way to do it, can you help me with that?
>>
>> Thank you so much, I hope this is the right place for this type of
>> questions.
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>

--
Jon Roelofs
[hidden email]
CodeSourcery / Mentor Embedded
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building and inspecting CFGs

Vassil Vassilev via cfe-dev
Thank you for quickly answering my question. it seems like the static analysis tool interface is the better way to perform this task. After reading the CFG.cpp and CFG.h I think that building the CFG on my own from the AST can be a big amount of work and a little bit tedious.

2016-05-24 23:36 GMT+02:00 Jonathan Roelofs <[hidden email]>:


On 5/24/16 3:33 PM, Alexey Sidorin via cfe-dev wrote:
Hello,

In Clang tools, you can use CFG class (search for CFG.cpp, CFG.h).
However, I'm not sure if it is available with Python bindings.


23.05.2016 22:28, shr dev via cfe-dev пишет:
Hi everyone,

I am trying to build a C static analysis tool and in order to make
some procedures I need to build Control Flow Graphs. I am using clang

There's already a bunch of infrastructure in place for this... are you sure you want to start from scratch? (It uses the CFG infra that Alexey mentioned).

http://clang-analyzer.llvm.org/


Jon


for parsing the c files and building the AST, in particular I am
working with python bindings. I was wondering if there is any way to
build and interact with a Control Flow Graph in the same way I can do
it throught the AST with pyhton bindings.
I inspected the files and I realized that with python bindings this is
not possible (maybe I am wrong since I am a little newbie). Maybe
exist another way to do it, can you help me with that?

Thank you so much, I hope this is the right place for this type of
questions.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


--
Jon Roelofs
[hidden email]
CodeSourcery / Mentor Embedded


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev