Exemplo n.º 1
0
def funsCallGraph(funs,dir_name,ignore_funs):
    #dict to dicts of fun to funcs called
    cg = {}
    ignore_funs = ignore_funs + [f for f in funs if isSpecIns(f)]
    for f in funs:
        if isSpecIns(f):
            continue
        cg[f] = gFuncsCalled(f,funs,ignore_funs)
    return cg
Exemplo n.º 2
0
def funsCallGraph(funs, dir_name, ignore_funs):
    #dict to dicts of fun to funcs called
    cg = {}
    ignore_funs = ignore_funs + [f for f in funs if isSpecIns(f)]
    for f in funs:
        if isSpecIns(f):
            continue
        cg[f] = gFuncsCalled(f, funs, ignore_funs)
    return cg
Exemplo n.º 3
0
def transitivelyCalled(f,cg):
    ret = set()
    vs = list(cg[f]) # copy the list
    #print '     cg[%s] : %s' % (f, cg[f])
    while vs:
       ff = elfFile().gFunName(vs.pop())
       assert '.' not in ff
       if ff not in ret and not isSpecIns(ff):
          ret.add(ff)
          vs += cg[ff]
    return ret
Exemplo n.º 4
0
def transitivelyCalled(f, cg):
    ret = set()
    vs = list(cg[f])  # copy the list
    #print '     cg[%s] : %s' % (f, cg[f])
    while vs:
        ff = elfFile().gFunName(vs.pop())
        assert '.' not in ff
        if ff not in ret and not isSpecIns(ff):
            ret.add(ff)
            vs += cg[ff]
    return ret