Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ValekoZ committed Jun 9, 2024
1 parent 9167635 commit 2bf489b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -8912,8 +8912,8 @@ class ArgType(enum.Enum):

for entry in vmmap:
names_filter = [f"name = '{x}'" for x in names if x in entry.path]
addrs_filter = [f"addr = " + self.format_addr_filter(arg, addr) for arg, addr in addrs.items()
if addr >= entry.page_start and addr < entry.page_end]
addrs_filter = [f"addr = {self.format_addr_filter(arg, addr)}" for arg, addr in addrs.items()
if entry.page_start <= addr < entry.page_end]
filters = names_filter + addrs_filter
filter_content = f"[{' & '.join(filters)}]"

Expand All @@ -8930,10 +8930,8 @@ class ArgType(enum.Enum):
gef_print()
return

def format_addr_filter(self, arg, addr):
if self.is_integer(arg):
return f"`{arg}`"
return f"`{arg}` ({addr:#x})"
def format_addr_filter(self, arg: str, addr: int):
return f"`{arg}`" if self.is_integer(arg) else f"`{arg}` ({addr:#x})"

def print_entry(self, entry: Section) -> None:
line_color = ""
Expand Down

0 comments on commit 2bf489b

Please sign in to comment.