Post by Ãmer Sinan AÄacan
Do we have a C API for GDB? Something that allows me to run all the
GDB commands/functions that I can run in GDB prompt, but without
messing with GDB prompt?
Python API is not great for what I want to do. I want to run GDB
inside a program, search for some specific currently-running
processes, attach to them, add some breakpoints etc. although all of
those are possible with Python API, 1) I'm not huge fan of the
language 2) I feel like most things would be a lot easier if I could
use a C API that allows me to drive GDB itself.
There is not. Your options are to use the GDB/MI interface or use the
If you want to use the GDB/MI interface, congratulations, you have to
read and interpret the spec, find all the bugs in it, write a parser
to support all the cases and test it against old and new versions of
GDB. It's a daunting task, I know, I'm working on it.
I don't expect to be done implementing and testing this for a long time.
If you want to use the GDB python interface you need to understand that
many GDB deployments do not have the python interpreter built into them.
Also, I'm not sure anyone has successfully tried to control GDB through
the python interface while allowing the user to use the cli interface.
Not sure if this is your goal.
Both of these approaches are possible, but not for the faint of heart.