Add memoize command for toggling caching, useful for debugging pwndbg

pull/880/head
Artur Cygan 4 years ago committed by Disconnect3d
parent 69094409f5
commit c93bc3e70c

@ -30,6 +30,7 @@ import pwndbg.commands.hexdump
import pwndbg.commands.ida
import pwndbg.commands.leakfind
import pwndbg.commands.misc
import pwndbg.commands.memoize
import pwndbg.commands.mprotect
import pwndbg.commands.next
import pwndbg.commands.peda
@ -161,5 +162,5 @@ signal.signal(signal.SIGWINCH, lambda signum, frame: gdb.execute("set width %i"
if 1:
gdb.execute('set remote search-memory-packet off')
# Reading Comment file
# Reading Comment file
pwndbg.commands.comments.init()

@ -0,0 +1,21 @@
#!/usr/bin/env python
import argparse
import pwndbg.commands
from pwndbg.color import message
parser = argparse.ArgumentParser(description='''
Toggles memoization (caching). Pwndbg will work slower when it's off, however
it's useful for diagnosing caching-related bugs.
''')
@pwndbg.commands.ArgparsedCommand(parser)
def memoize():
pwndbg.memoize.memoize.caching = not pwndbg.memoize.memoize.caching
status = message.off('OFF (pwndbg will work slower, use only for debugging pwndbg)')
if pwndbg.memoize.memoize.caching:
status = message.on('ON')
print("Caching is now %s" % status)
Loading…
Cancel
Save