Export to GitHub

paimei - issue #12

Getting procedure's CFG and Call Graph of the module from pida_dump


Posted on Aug 3, 2010 by Happy Rabbit

I understand that pida stores each node as "dict" data structure which is, by definition, unordered. This creates a problem when trying to traverse call graph or CFG in ordered form i.e. I want to traverse nodes as they appear in call graph. Similarly, I want to traverse basic-block as they appear in CFG of a function. In other words, I should be able to get predecessor/successor of the current BB. I notice that as node ids are not necessarily in any order, it really becomes difficult (impossible?) to iterate through module/functions as per call-graph/CFG. I shall appreciate if anyone can provide some hint to do the same.

thanks -Sanjay

Comment #1

Posted on Aug 3, 2010 by Happy Rabbit

I think it is, by mistake, tagged as Defect. This issue is not about any defect, but rather asking for a solution or improvement in functionality.

Comment #2

Posted on Aug 4, 2010 by Happy Rabbit

Another thing that i observe is that "label" variable for any basic_block is always empty. This is again creating a problem in order to build a CFG. I don't know if I am missing some functionality, but it rather surprising that basic_block class does not have "previous" and "next" method to know a "list" of nodes (BB) that are dominator (immediate predecessor) and immediate successor of the current BB. Please help if I am really missing something!!

Comment #3

Posted on Aug 15, 2010 by Happy Rabbit

Ok. I think, I misunderstood the methods. There is a method edge_from(), which can be used to go to next BB in the CFG of a function. Earlier, I had the impression that such method is available at basic_blocks level.

Comment #4

Posted on Jan 24, 2011 by Quick Monkey

looks like there is no real problem. This functionality is available at the function leverl. It could have been available at the bb level also but the current way of accesing it is is ok.

Status: WontFix

Labels:
Type-Defect Priority-Medium