GDB cannot exec my test program@Barmar It doesn't need to, but it does so to make it easier for the user. For instance, it allows you to specify command arguments that can be expanded by the shell (for instance globs such as * in paths). In gdb 7.7 or greater, set startup-with-shell false will tell gdb to exec your program directly. In versions older than that, it is a compile-time option.