In gdb, we normally use r > log.txt to redirect stdout. This also runs the program.
Is there a way to redirect stdout (only, not stdin) without actually starting the program?
My intended workflow is:
redirect stdout to log.txt
call func1(a, b, c) # I want the stdout output going to log.txt, without any gdb info, just stdout
Note that tty command won't work in this case (I want to redirect stdout only).