Running GDB with args and variables

Mahmood Naderan nt_mahmood@yahoo.com
Fri Aug 27 18:28:11 GMT 2021


Hi

I use the following command to run a program

$ LD_PRELOAD=/home/mahmood/foo.so /home/mahmood/program/run /home/mahmood/p2/bin/p2 -config t.txt

Now I want to use 'gdb --args' but the following command doesn't work.


$ gdb --args LD_PRELOAD=/home/mahmood/foo.so /home/mahmood/program/run /home/mahmood/p2/bin/p2 -config t.txt
...

For help, type "help".
Type "apropos word" to search for commands related to "word"...
LD_PRELOAD=/home/mahmood/foo.so: No such file or directory.
(gdb)




The "No such file" error is weird because the file exists when I run 'ls' command.

Any idea about that?

Regards,
Mahmood


More information about the Gdb mailing list