Skip to content

Commit

Permalink
- added cache management for Architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Jan 30, 2022
1 parent 8c8c838 commit 283690a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,10 @@ def mprotect_asm(cls, addr: int, size: int, perm: Permission) -> str: pass
aliases: Tuple[Union[str, int], ...] = []
special_registers: List[str] = []

def reset_caches(self) -> None:
self.__get_register_for_selected_frame.cache_clear()
return

def __get_register(self, regname: str) -> Optional[int]:
"""Return a register's value."""
curframe = gdb.selected_frame()
Expand Down Expand Up @@ -11546,7 +11550,7 @@ def setup(self) -> None:
def reset_caches(self) -> None:
"""Recursively clean the cache of all the managers. Avoid calling this function directly, using `reset-cache`
is preferred"""
for mgr in (self.memory, self.heap, self.session):
for mgr in (self.memory, self.heap, self.session, self.arch):
mgr.reset_caches()
return

Expand Down

0 comments on commit 283690a

Please sign in to comment.