def signature(self, func=None): """provides the signature of a given function, or the entire signature string. """ if func is not None: return cfg.signature(func.cfg) return self.G.signature()
def __init__(self, f, data): from amoco.cfg import signature self.name = f.name self.sig = signature(f.cfg) self.blocks = f.cfg.order() self.argsin = f.misc["func_in"] self.argsout = f.misc["func_out"] self.stksz = min([0] + [x.a.disp for x in f.misc["func_var"]]) self.vaddr = str(f.address) self.bsize = sum([b.length for b in f.blocks], 0) self.nbinst = sum([len(b.instr) for b in f.blocks], 0) self.calls = " ".join( filter(None, [x.name if hasattr(x, "cfg") else None for x in f.blocks]) ) self.xrefs = " ".join( [str(x.data.support[1]) for x in f.cfg.sV[0].data.misc["callers"]] )