I have some program, the essence of which is to analyze crashes, it works with GDB.
An example of how it works: I run an application in GDB which I want to analyze for crashes, then I load my program into GDB using "source", write "run" to make the application work, then if it crashes I write "analyze" (this command triggers my crash analysis program) and then I get a full report on the error. My program is written entirely in python.
Question: can I write a script in python or something else that will allow me to make an executable file, that will run the whole process described above, without running gdb manually and writing there the commands "source", "analyze", "run" etc.. Basically, I need to somehow make a program where I will pass the target (the application for analysis), maybe an input file (for example, the program under study needs a file which will crash), and this program will run the GDB, write "source", "analyze", etc., and then generate a report in a text file.
I tried to find information on google, but unfortunately without success. Maybe I wasn't looking that hard, I don't know. Ubuntu 20.04.