FIX: pwndbg.gdblib.regs.frame is None (#1966)

This commit reverts a previous commit that removed check against the frame register.
* FIX: revert c37030633a as pwndbg.gdblib.regs.frame can be None

The reason for that is that when you debug Chrome on arm64 using a gdbserver, we may end up with a "Unknown register type: None" message printed out due to lack of this check.

The stacktrace for this message can be found below:
```
Unknown register type: None
Traceback (most recent call last):
  File "/home/pwndbg/pwndbg/commands/__init__.py", line 181, in __call__
    return self.function(*args, **kwargs)
  File "/home/pwndbg/pwndbg/commands/__init__.py", line 328, in _OnlyWhenRunning
    return function(*a, **kw)
  File "/home/pwndbg/pwndbg/commands/telescope.py", line 197, in telescope
    bp = pwndbg.gdblib.regs[pwndbg.gdblib.regs.frame]
  File "/home/pwndbg/pwndbg/lib/cache.py", line 138, in decorator
    value = func(*a, **kw)
  File "/home/pwndbg/pwndbg/gdblib/regs.py", line 66, in __getitem__
```
---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
pull/1969/head
HackSys Team 2 years ago committed by GitHub
parent 7d0cf3933a
commit e230a853d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -192,8 +192,8 @@ def telescope(address=None, count=telescope_lines, to_string=False, reverse=Fals
collapse_buffer.clear()
bp = None
if print_framepointer_offset:
# If pwndbg.gdblib.regs.frame is None, indexing regs will return None
if print_framepointer_offset and pwndbg.gdblib.regs.frame is not None:
# regs.frame can be None on aarch64
bp = pwndbg.gdblib.regs[pwndbg.gdblib.regs.frame]
for i, addr in enumerate(range(start, stop, step)):

Loading…
Cancel
Save