Is there any way to invoke GDB and control, access it from c++ program?
Asked
Active
Viewed 292 times
3
-
I'm not sure about C++, but the Python bindings might work well for you: http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html – Travis Gockel Aug 19 '11 at 05:03
-
@Travis Gockel: Thanks for the link. I'll try to get the information from this to get it work in c++. – Ambuja Aug 19 '11 at 05:05
1 Answers
6
Yes. Execute it with redirected input/output and simply control it through the pipes.
EDIT:
It depends on where you want to do it. On Windows you can use the following: http://msdn.microsoft.com/en-us/library/ms682499%28v=vs.85%29.aspx
On *nix, the steps described in Linux Pipes as Input and Output SO answer should do it.
-
@Ambuja: I have edited the answer with links to explain how you could do it. – wilx Aug 19 '11 at 07:32