C / C ++的Linux GDB API [英] C/C++ Linux GDB API

查看:325
本文介绍了C / C ++的Linux GDB API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要让我的 GDB 命令行程序的一个小GUI版本的的Linux 来使调试小 C 程序更加容易。有可能已经存在着一些特别是在集成开发环境,但我想让它为乐趣,并得到更好地了解 GDB

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.

现在我想知道GDB是否有一个API,这样我就可以访问GDB直接从code命令,我没有通过终​​端例如使用的popen

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.

如果有不存在从 GDB 这样的API,最新启动的最简单方法 GDB 隐藏和发送命令它,从中检索输出?

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?

推荐答案

许多IDE,比如Eclipse和KDevelop的使用GDB的MI(人机界面)。它是基于行的机器面向文本界面GDB。这里查看完整列表: https://sourceware.org/gdb/wiki/GDB%20Front% 20Ends

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.

请参阅以下链接开始使用GDB MI:

See these links to get started with GDB MI:

  • https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html
  • http://www.ibm.com/developerworks/library/os-eclipse-cdt-debug2/

这篇关于C / C ++的Linux GDB API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆