def set_metadata(self, lldb_obj: lldb.SBValue): self.__dict__["@type_name"] = lldb_obj.GetTypeName() self.__dict__["@location"] = lldb_obj.GetLocation() if lldb_obj.GetNumChildren() == 0: self.__dict__["@value"] = lldb_obj.GetValue() self.__dict__["@value_unsigned"] = lldb_obj.GetValueAsUnsigned() self.__dict__["@value_signed"] = lldb_obj.GetValueAsSigned()
def addOneShotBreakPointInIMP(imp: lldb.SBValue, callbackFunc: str, name: str) -> None: target = lldb.debugger.GetSelectedTarget() bp = target.BreakpointCreateByAddress(imp.GetValueAsUnsigned()) bp.AddName(name) bp.SetOneShot(True) bp.SetScriptCallbackFunction(callbackFunc)