def__repr__(self):result=f"<CallSite in function {self.caller_func_addr:#x}, calling {self.callee_func_addr:#x}"ifself.block_addrisnotNone:result+="at block %#x"%self.block_addrresult+=">"returnresultdef__eq__(self,other):return(self.caller_func_addr==other.caller_func_addrandself.callee_func_addr==other.callee_func_addrandself.block_addr==other.block_addr)
[docs]classCallTrace:""" Describes a series of functions calls to get from one function (current_function_address()) to another function or a basic block (self.target). """__slots__=("callsites","target",)
[docs]defstep_back(self,caller_func_addr:int,block_addr:Optional[int],callee_func_addr)->"CallTrace":# create a new CallSite objectsite=CallSite(caller_func_addr,block_addr,callee_func_addr)t=self.copy()t.callsites.append(site)returnt