Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed May 1, 2024
1 parent fc6f8ec commit a328286
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 9 additions & 4 deletions archs/arm-blackmagicprobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand All @@ -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
Expand All @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions archs/arm-openocd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})"
Expand Down

0 comments on commit a328286

Please sign in to comment.