Reputation: 169
I'm trying to debug the program remotely with gdbserver.
The following works fine:
gdbserver :1234 ./test-program
But I need to debug the program with preloaded .so file. And this doesn't work:
gdbserver :1234 'LD_PRELOAD=./libefence.so ./test-program'
How to do this?
Tried also to use exec wrapper, but this doesn't work either:
gdbserver --wrapper 'LD_PRELOAD=./libefence.so' -- :1234 ./test-program
Upvotes: 0
Views: 1629
Reputation: 169
Found the solution:
gdbserver --wrapper env 'LD_PRELOAD=./libefence.so' -- :1234 ./test-program
Upvotes: 2