I have a GDB script which I pass to GDB:
gdb -x my_script.gdb
Inside my_script.gdb I have a variable, say foo, which I use as a parameter. Right now, I manually change foo inside the script whenever I want to try a different value for foo.
What I would like to do, is pass a command-line parameter when launching GDB with the command above, so that foo takes the value of that parameter. Is this possible?
gdbin which case you can definitely have arguments if thegdbscript doesn't let you. Alternatively, you can write a Bash script that outputs line-separated commands and you can pipe that togdb.