I have a program and I am trying to debug it using gdb. Inside the program I have methods that require the user to enter an input using stdin. How can I enter this input whe
You can also run your program first, then attach GDB to it:
gdb --pid $(pgrep your_program)
This way you will be able to run your program interactively in a separate terminal.