diff --git a/archs/arm-blackmagicprobe.py b/archs/arm-blackmagicprobe.py index 497f004..5f1e948 100644 --- a/archs/arm-blackmagicprobe.py +++ b/archs/arm-blackmagicprobe.py @@ -104,7 +104,12 @@ def __init__(self, tty: str="", file: str="", attach: int=1, self.__power = power self.__keep_power = keep_power self.__local_root_fd = tempfile.TemporaryDirectory() - self.__local_root_path = pathlib.Path(self.__local_root_fd.name) + self.__local_root_path = Path(self.__local_root_fd.name) + class BMPMode(): + def prompt_string(self) -> str: + return Color.boldify("(BMP) ") + + self._mode = BMPMode() def __str__(self) -> str: return f"BMPRemoteSessionManager(tty='{self.__tty}', file='{self.__file}', attach={self.__attach})" @@ -121,7 +126,7 @@ def close(self) -> None: return @property - def root(self) -> pathlib.Path: + def root(self) -> Path: return self.__local_root_path.absolute() @property @@ -133,9 +138,9 @@ def sync(self, src: str, dst: Optional[str] = None) -> bool: return None @property - def file(self) -> Optional[pathlib.Path]: + def file(self) -> Optional[Path]: if self.__file: - return pathlib.Path(self.__file).expanduser() + return Path(self.__file).expanduser() return None def connect(self) -> bool: diff --git a/archs/arm-openocd.py b/archs/arm-openocd.py index e97c7b3..8de3b6f 100644 --- a/archs/arm-openocd.py +++ b/archs/arm-openocd.py @@ -29,7 +29,7 @@ def supports_gdb_arch(arch: str) -> Optional[bool]: @staticmethod def maps(): - yield from gef.memory.parse_info_mem() + yield from GefMemoryManager.parse_info_mem() @register @@ -96,7 +96,12 @@ def __init__(self, host: str, port: str, file: str="") -> None: self.__port = port self.__file = file self.__local_root_fd = tempfile.TemporaryDirectory() - self.__local_root_path = pathlib.Path(self.__local_root_fd.name) + self.__local_root_path = Path(self.__local_root_fd.name) + class OpenOCDMode(): + def prompt_string(self) -> str: + return Color.boldify("(OpenOCD) ") + + self._mode = OpenOCDMode() def __str__(self) -> str: return f"OpenOCDRemoteSessionManager(='{self.__tty}', file='{self.__file}', attach={self.__attach})"