Author Topic: Tutorial how to control GDB from an external process (similar how C::B does it)  (Read 4027 times)

Offline Napoleon

  • Multiple posting newcomer
  • *
  • Posts: 59
I have a project at Uni I've been asked to do where I need to launch GDB send commands to it from a controlling program.  GDB will, in turn, be used to debug another process.  In essences, pretty much how C::B operates GDB.
Would anyone be able to share a link to some information or tutorials on how this can be done?

The controlling process is written in Obj-C ++ and runs on both OSX and Ubuntu.  I'm planning to work on it in Ubuntu using C::B.
The process that GDB will debug is written in C++.

Cheers,
Nap

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Communicate gdb through command line pipe.
Also I suggest you use the gdb's MI interface.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Another option as far as I know is to use the python api, but this is not a place where you'll receive enough up to date information.
It is best to ask your question on the gdb mailing list, there you'll find more knowledgeable people about this matter.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Napoleon

  • Multiple posting newcomer
  • *
  • Posts: 59
Thanks for the hints.