0

I need a c++ script to automate GDB debugging another c++ program. the c++ script has to be able to run gdb commands and get the results from it and use it inside the script to save variable values for later usage, my main questions are:

  1. is there a c++ library for using GDB programmatically (running gdb commands like

continue

step into

) and getting value variables

  1. if there is no library, how can I implement the c++ script myself?
  2. can I use a python script instead of a c++ script to debug the c++ program?
  3. if it is possible to use python, what libraries can I use for using GDB programmatically in python?
  4. giving an implementation example for scripts would be a good guideline and help

thanks

3
  • 1
    You can build gdb with Python support (or you might already have it). Commented Feb 9, 2023 at 9:44
  • BTW: I found that out by entering "gdb python" in a search engine. Commented Feb 9, 2023 at 9:58
  • gdb usually comes with Python support enabled by default. Commented Feb 9, 2023 at 10:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.