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?


1 Answer 1


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


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .