From 1d4828b87da9837fc3df81e81da1763d337fc420 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 8 Sep 2023 22:56:02 +0200 Subject: gdbserver: add exec wrapper example --- src/tools/gdbserver.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/gdbserver.md b/src/tools/gdbserver.md index 5f85e0a..203846d 100644 --- a/src/tools/gdbserver.md +++ b/src/tools/gdbserver.md @@ -7,13 +7,14 @@ opts: --disable-randomization --no-disable-randomization + --wrapper W -- comm: host:port tty ``` -# Example +## Example ```markdown # Start gdbserver. @@ -22,3 +23,11 @@ gdbserver localhost:1234 /bin/ls # Attach gdb. gdb -ex 'target remote localhost:1234' ``` + +## Wrapper example: Set environment variables just for the debugee +Set `env` as execution wrapper with some variables. +The wrapper will be executed before the debugee. + +```markdown +gdbserver --wrapper env FOO=123 BAR=321 -- :12345 /bin/ls +``` -- cgit v1.2.3