1

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?

Mohammed
  • 157

1 Answers1

3

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
Mohammed
  • 157