I automate my gdb script like this
gdb -q --args the_program <<EOL
# breakpoints etc.
run
EOL
Works fine, however when interrupting the running process with Ctrl+C, the entire process falsely exits:
Quit anyway? (y or n) [answered Y; input not from terminal]
, meaning gdb is not interactive anymore. How do I prevent this?
For some reason, the interrupt signal works fine when using an external commands file like gdb ... -x the_commands_file
. But this question is about the stdin-way. Is there a possibility to send the desired commands via stdin but still be able to keep interaction possible afterwards?