I\'d like to write a script that (under certain conditions) will execute gdb and automatically run some program X with some set of arguments Y. Once the program has finishe
there is option -x, e.g.
gdb -x gdb_commands exe_file
where gdb_commands can be for example (in the case of android emulator):
target remote :5039