Skip to content

Commit

Permalink
Don't go through a shell in gdb.debug (#2378)
Browse files Browse the repository at this point in the history
* Don't go though a shell in `gdb.debug`

gdbserver starts a shell and runs the target process through it.
This behavior was added in gdbserver 8.0 together with the
commandline flag --no-startup-with-shell to disable it.

* Update CHANGELOG
  • Loading branch information
peace-maker committed Apr 21, 2024
1 parent 6007248 commit db98e5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The table below shows which release corresponds to each branch, and what date th
| ---------------- | -------- | ---------------------- |
| [4.14.0](#4140-dev) | `dev` |
| [4.13.0](#4130-beta) | `beta` |
| [4.12.1](#4121) | |
| [4.12.0](#4120-stable) | `stable` | Feb 22, 2024
| [4.11.1](#4111) | | Nov 14, 2023
| [4.11.0](#4110) | | Sep 15, 2023
Expand Down Expand Up @@ -130,9 +131,12 @@ The table below shows which release corresponds to each branch, and what date th
[2233]: https://github.com/Gallopsled/pwntools/pull/2233

## 4.12.1

- [#2373][2373] Fix displaying bright color variation in terminal output
- [#2378][2378] Don't go though a shell in `gdb.debug`

[2373]: https://github.com/Gallopsled/pwntools/pull/2373
[2378]: https://github.com/Gallopsled/pwntools/pull/2378

## 4.12.0 (`stable`)

Expand Down
4 changes: 3 additions & 1 deletion pwnlib/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ def _gdbserver_args(pid=None, path=None, args=None, which=None, env=None):

orig_args = args

gdbserver_args = [gdbserver, '--multi']
# --no-startup-with-shell is required for forking shells like SHELL=/bin/fish
# https://github.com/Gallopsled/pwntools/issues/2377
gdbserver_args = [gdbserver, '--multi', '--no-startup-with-shell']
if context.aslr:
gdbserver_args += ['--no-disable-randomization']
else:
Expand Down

0 comments on commit db98e5e

Please sign in to comment.