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 judgeSBValueHasValue(val: lldb.SBValue) -> bool: if val.GetValue() is None or val.GetValueAsSigned() == 0: return False return True
def logRedirectResult(val: lldb.SBValue, stream: str) -> None: if val.GetValueAsSigned() == 0: HM.DPrint(f"redirect {stream} failed") else: HM.DPrint(f"redirect {stream} successful")