An introduction to GCC and GCC’s plugins

1. Brief introduction to GNU’s GCC The GNU toolchain is a collection of tools and libraries produced in the context of the GNU project. In 1983, Richard Stallman announced the GNU project. Its goal was to give the community freedom and control in their use of computing devices by developing (collaboratively) free software and letting users modify, copy, and distribute it freely. The GNU toolchain was part of that software and today includes some of the most widespread tools used to develop and compile application such as: GNU make:…

How to run a program with commandline arguments using GDB within a Bash script?

Run gdb with --args parameter: gdb --args executablename arg1 arg2 arg3 If you are doing this often (e.g. when running GDB from a script), you might want to consider the following arguments to automate things further. First, you can place your GDB commands (such as 'run') in a text file and provide the filename to the -x argument. Second, you can have GDB exit after running your commands by providing the --batch argument. A full example: gdb -x commands.txt --batch --args executablename arg1 arg2 arg3