C/C++ Linux GDB API [closed]

2020-03-01 05:01发布

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?

标签: c++ c linux gdb
1条回答
我想做一个坏孩纸
2楼-- · 2020-03-01 05:37

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:

查看更多
登录 后发表回答