Skip to content

Commit af6c8c8

Browse files
committed
gdb.debug: gdbserver --wrapper requires startup-with-shell
Only add it when we don't want to manipulate the environment or argv[0]. This will cause the problem with fish shell to reappear in those cases, but it's another step for compatibility at least. #2378
1 parent 55390f1 commit af6c8c8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pwnlib/gdb.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ def _gdbserver_args(pid=None, path=None, args=None, which=None, env=None, python
323323

324324
orig_args = args
325325

326-
# --no-startup-with-shell is required for forking shells like SHELL=/bin/fish
327-
# https://github.com/Gallopsled/pwntools/issues/2377
328-
gdbserver_args = [gdbserver, '--multi', '--no-startup-with-shell']
326+
gdbserver_args = [gdbserver, '--multi']
329327
if context.aslr:
330328
gdbserver_args += ['--no-disable-randomization']
331329
else:
@@ -348,6 +346,10 @@ def _gdbserver_args(pid=None, path=None, args=None, which=None, env=None, python
348346
gdbserver_args += ['--wrapper', python_wrapper_script, '--']
349347
elif env is not None:
350348
gdbserver_args += ['--wrapper', which('env'), '-i'] + env_args + ['--']
349+
# --no-startup-with-shell is required for forking shells like SHELL=/bin/fish
350+
# https://github.com/Gallopsled/pwntools/issues/2377
351+
else:
352+
gdbserver_args += ['--no-startup-with-shell']
351353

352354
gdbserver_args += ['localhost:0']
353355
gdbserver_args += args

0 commit comments

Comments
 (0)