I want to make me a small GUI version of the GDB
command line program on Linux
to make debugging of small C
programs more easier. There may exists already some especially in IDEs but I want to make it for fun and get better known to GDB
.
Now I wanted to know whether GDB has a API so I can access GDB commands directly from code and I don't have to make a detour through the terminal for example with popen
.
If there does not exists such a API from GDB
, whats the simplest way to start GDB
hidden and send commands to it, retrieve outputs from it?
Many IDEs such as Eclipse and KDevelop use GDB MI (Machine Interface). It is line based machine oriented text interface to GDB. See full list here: https://sourceware.org/gdb/wiki/GDB%20Front%20Ends.
See these links to get started with GDB MI: