Skip to content

Commit

Permalink
added a simple helper reset() that allows to entirely reset the gef…
Browse files Browse the repository at this point in the history
… session using `pi reset()`
  • Loading branch information
hugsy committed Jan 7, 2022
1 parent f0126ce commit 8262adc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions gef.py
Expand Up @@ -185,6 +185,22 @@ def reset_all_caches():
gef.reset_caches()
return

def reset():
global gef

arch = None
if gef:
reset_all_caches()
arch = gef.arch
del gef

gef = None
gef = Gef()
gef.setup()

if arch:
gef.arch = arch
return

def highlight_text(text):
"""
Expand Down Expand Up @@ -11548,8 +11564,7 @@ def reset_caches(self):
pass

# load GEF
gef = Gef()
gef.setup()
reset()

# gdb events configuration
gef_on_continue_hook(continue_handler)
Expand Down

0 comments on commit 8262adc

Please sign in to comment.