How to bind the entry point of a CFG

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

How to bind the entry point of a CFG

Kristof Beyls via cfe-dev
Dear Member,
I am new to clang framework. I am trying to bind the entry points of CFG by using below code.

StatementMatcher BBlock= CFGBlock(expr().bind("entrypoint"));


The code giving me errors. Please guide me, how can I bind entry and exit points of CFG of a program.

Regards



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

Re: How to bind the entry point of a CFG

Kristof Beyls via cfe-dev
Hi!

You can retrieve the entry point of a CFG with the getEnty() method. https://clang.llvm.org/doxygen/classclang_1_1CFG.html#a376a2e0d1a66a46f6514fe9b863f1f52 Could elaborate on what you'd like to achieve?

Cheers,
Kristóf

On Sun, 27 Oct 2019 at 08:14, Ijaz Ahmed via cfe-dev <[hidden email]> wrote:
Dear Member,
I am new to clang framework. I am trying to bind the entry points of CFG by using below code.

StatementMatcher BBlock= CFGBlock(expr().bind("entrypoint"));


The code giving me errors. Please guide me, how can I bind entry and exit points of CFG of a program.

Regards


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

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

Re: How to bind the entry point of a CFG

Kristof Beyls via cfe-dev
Actually I want to analyze the basic block of a program for fault localization. I have a pointer to CFG and from that pointer I can access every basic block. Consequently this will allow me to access the entry and exit. But by somehow, I am failed to
(1) locate the position (line and column number) of entry and exit point of basic block,
(2) iterate over the statements of the basic block through CFGElement object. I am using the srcManager to identify the position (line and col number).
Anyhow, thank you for your reply.

Regards
ijaz

On Tue, Oct 29, 2019 at 8:37 PM Kristóf Umann <[hidden email]> wrote:
Hi!

You can retrieve the entry point of a CFG with the getEnty() method. https://clang.llvm.org/doxygen/classclang_1_1CFG.html#a376a2e0d1a66a46f6514fe9b863f1f52 Could elaborate on what you'd like to achieve?

Cheers,
Kristóf

On Sun, 27 Oct 2019 at 08:14, Ijaz Ahmed via cfe-dev <[hidden email]> wrote:
Dear Member,
I am new to clang framework. I am trying to bind the entry points of CFG by using below code.

StatementMatcher BBlock= CFGBlock(expr().bind("entrypoint"));


The code giving me errors. Please guide me, how can I bind entry and exit points of CFG of a program.

Regards


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

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

Re: How to bind the entry point of a CFG

Kristof Beyls via cfe-dev
Can you please guide me (possibly with a snippet of code) that how may I iterate over the statements inside a basic block.  Lets suppose, I have a pointer to basic block ptrBB.



On Wed, Oct 30, 2019 at 12:19 PM Ijaz Ahmed <[hidden email]> wrote:
Actually I want to analyze the basic block of a program for fault localization. I have a pointer to CFG and from that pointer I can access every basic block. Consequently this will allow me to access the entry and exit. But by somehow, I am failed to
(1) locate the position (line and column number) of entry and exit point of basic block,
(2) iterate over the statements of the basic block through CFGElement object. I am using the srcManager to identify the position (line and col number).
Anyhow, thank you for your reply.

Regards
ijaz

On Tue, Oct 29, 2019 at 8:37 PM Kristóf Umann <[hidden email]> wrote:
Hi!

You can retrieve the entry point of a CFG with the getEnty() method. https://clang.llvm.org/doxygen/classclang_1_1CFG.html#a376a2e0d1a66a46f6514fe9b863f1f52 Could elaborate on what you'd like to achieve?

Cheers,
Kristóf

On Sun, 27 Oct 2019 at 08:14, Ijaz Ahmed via cfe-dev <[hidden email]> wrote:
Dear Member,
I am new to clang framework. I am trying to bind the entry points of CFG by using below code.

StatementMatcher BBlock= CFGBlock(expr().bind("entrypoint"));


The code giving me errors. Please guide me, how can I bind entry and exit points of CFG of a program.

Regards


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

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