Fix memoize debug path (#1510)

This fixes memoize when debug=True is set in pwndbg/lib/memoize.py

Before this commit, one gets the following error:
```
dc@jhtc:~$ gdb
Executed: <stop-memoized function pwndbg.ida.available>(())
.... False
Traceback (most recent call last):
  File "/home/dc/pwndbg/gdbinit.py", line 100, in <module>
    import pwndbg  # noqa: F401
  File "/home/dc/pwndbg/pwndbg/__init__.py", line 11, in <module>
    load_commands()
  File "/home/dc/pwndbg/pwndbg/commands/__init__.py", line 601, in load_commands
    import pwndbg.commands.cymbol
  File "/home/dc/pwndbg/pwndbg/commands/cymbol.py", line 53, in <module>
    pwndbg_cachedir = pwndbg.lib.tempfile.cachedir("custom-symbols")
  File "/home/dc/pwndbg/pwndbg/lib/memoize.py", line 52, in __call__
    print("%s: %s(%r)" % (how, self, args))
  File "/home/dc/pwndbg/pwndbg/lib/memoize.py", line 58, in __repr__
    return "<%s-memoized function %s>" % (self.kind, funcname)
AttributeError: 'forever' object has no attribute 'kind'
/home/dc/.gdbinit:12: Error in sourced command file:
No symbol table is loaded.  Use the "file" command.
```
pull/1513/head
Disconnect3d 3 years ago committed by GitHub
parent 7e519bb660
commit 85e55130d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -70,8 +70,8 @@ class forever(memoize):
"""
Memoizes forever - for a pwndbg session or until `_reset` is called explicitly.
"""
caches = [] # type: List[forever]
kind = "forever"
@staticmethod
def _reset() -> None:

Loading…
Cancel
Save