Here's a general example of what I need to do:
For example, I would initiate a back trace by sending the command "bt" to GDB from the program. Then I would search for a word such as "pardrivr" and get the line number associated with it by using regular expressions. Then I would input "f [line_number_of_pardriver]" into GDB. This process would be repeated until the correct information is eventually extracted.
I want to use Python to accomplish this by creating a subprocess of GDB. Then I want to send commands to GDB and read output from GDB. I would use the output to send more commands to GDB dynamically based on the content of the output.
Could someone please provide a simple example of how to do this?
Thank you so much!