GDB – redirecting input and output streams

Sometimes, the easiest solutions are the best :) If you want to redirect input/output in gdb session it is as simple as that:

(gdb) run < input_stream_file > output_stream_file