I am trying to debug an error which i am hitting very rarely in a program. The program is running under valgrind
valgring --num-caller=50 testprog.out
I want to generate a core file only when this program hits the error.
I know there is an option to invoke gdb when we hit a error from valgring, But is there a way to give inputs to valgrind/gdb to generate core file without manual intervention?
Can I give inputs to gdb in a file?