From c5f5df8389b05bc68cb7d8ca06a14924b46369a4 Mon Sep 17 00:00:00 2001 From: Grazfather Date: Fri, 25 Aug 2023 21:05:03 -0400 Subject: [PATCH] Fix more gdb execute we can't quote --- gef.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gef.py b/gef.py index ef783d064..d79ed1cb7 100644 --- a/gef.py +++ b/gef.py @@ -2140,7 +2140,7 @@ def gef_execute_gdb_script(commands: str) -> None: fname = pathlib.Path(fname) if fname.is_file() and os.access(fname, os.R_OK): - gdb.execute(f"source '{fname}'") + gdb.execute(f"source {fname}") fname.unlink() return @@ -10150,7 +10150,7 @@ def tmux_setup(self) -> None: gdb.execute(f"!'{tmux}' select-pane -L") ok(f"Setting `context.redirect` to '{pty}'...") - gdb.execute(f"gef config context.redirect '{pty}'") + gdb.execute(f"gef config context.redirect {pty}") ok("Done!") return @@ -10176,7 +10176,7 @@ def screen_setup(self) -> None: with open(tty_path, "r") as f: pty = f.read().strip() ok(f"Setting `context.redirect` to '{pty}'...") - gdb.execute(f"gef config context.redirect '{pty}'") + gdb.execute(f"gef config context.redirect {pty}") ok("Done!") os.unlink(script_path) os.unlink(tty_path) @@ -10233,7 +10233,7 @@ def __install_extras_script(self, script: str) -> bool: fd.flush() old_command_set = set(gef.gdb.commands) - gdb.execute(f"source '{fpath}'") + gdb.execute(f"source {fpath}") new_command_set = set(gef.gdb.commands) new_commands = [f"`{c[0]}`" for c in (new_command_set - old_command_set)] ok(f"Installed file '{fpath}', new command(s) available: {', '.join(new_commands)}") @@ -11203,4 +11203,4 @@ def reset_caches(self) -> None: # 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(): - gdb.execute(f"source '{bkp_fpath}'") + gdb.execute(f"source {bkp_fpath}")