I want to run gdb
with only a single variable MyVar
in its environment.
However, the variable's contents are rather complex, containing non-printable ASCII, and so is best set using e.g. MyVar=$(python -c 'print("\xff...")')
.
I'm left with two options:
Set the
MyVar
inbash
before runninggdb
. Then insidegdb
, remove all other environment variables individually usingunset environment NAME
(very tedious!).Clear all environment variables using
unset environment
. Then insidegdb
, setMyVar
using a shell command (as above) (how?)
Any ideas?