开发者

How can i invoke gdb using python to run a module [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question

I have a requirement to run a 'C开发者_开发技巧'-module in gdb but this gdb should be involked by python script.


I think the best way to do this is to use subprocess:

subprocess.Popen(['gdb', 'arg1', 'arg2', 'etc'])

If you are using Python 2.x and you only want to record the output, you can use commands, but it is deprecated since 2.6.
You might want to check Invoke and control GDB from Python


Hacky solution as always: os.system.

os.system("gdb arg1 arg2 etc")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜