I run a program with LD_PRELOADing a specific library. Like this.
LD_PRELOAD=./my.so ./my_program
How do I run this program with gdb<
gdb<
Here is a way to run everything (with arguments and environment) as one command:
Example:
gdb --args env LD_PRELOAD=/usr/local/lib/libstderred.so ls -l
The keen observer will notice that env serves here as an exec wrapper (like Alexey Romanov's answer).
env