I have core dump file and gdb. I can do

 gdb <executable> <core_file>

This will give me backtrace but I want to do this using a shell script and in non-interactive mode. Writing gdb exe core takes me to gdb CLI and needs manual intervention. Any idea how can I automate it?


got it by --help

just write all the commands in a file, lets say file.txt. Pass this file in --command.

gdb --command=file.txt exe core_file

The content of file.txt


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.