0

I have core dump file and gdb. I can do

 gdb <executable> <core_file>
 (gdb)bt

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?

2

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

bt
quit

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.