3

Is there any way to invoke GDB and control, access it from c++ program?

Ambuja
  • 197
  • 1
  • 12
  • 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 Answers1

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.

Community
  • 1
  • 1
wilx
  • 17,697
  • 6
  • 59
  • 114