Skip to content

Commit

Permalink
Add a source post hook (#1059)
Browse files Browse the repository at this point in the history
Add a post hook to `source` to automatically reload `gef` commands and move `@register`-ed new commands to being active.
  • Loading branch information
hugsy authored Feb 1, 2024
1 parent 06478bd commit 4c307e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -11484,5 +11484,9 @@ def target_remote_posthook():

# restore saved breakpoints (if any)
bkp_fpath = pathlib.Path(gef.config["gef.autosave_breakpoints_file"]).expanduser().absolute()
if bkp_fpath.exists() and bkp_fpath.is_file():
if bkp_fpath.is_file():
gdb.execute(f"source {bkp_fpath}")

# Add a `source` post hook to force gef to recheck the registered plugins and
# eventually load the missing one(s)
gdb.execute("define hookpost-source\npi gef.gdb.load()\nend")

0 comments on commit 4c307e6

Please sign in to comment.