Skip to content

Commit

Permalink
Fix more gdb execute we can't quote
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed Aug 26, 2023
1 parent b989829 commit c5f5df8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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)}")
Expand Down Expand Up @@ -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}")

0 comments on commit c5f5df8

Please sign in to comment.