title: How to control gdb within C or Python code without the GDB Python API?
body: <p>I am trying to write a program in python or c that can debug c code by using gdb.</p>
  
  <p>I've read the <a href="http://tromey.com/blog/?p=548" rel="nofollow noreferrer">solution of Tom</a> and <a href="https://stackoverflow.com/questions/3482869/invoke-and-control-gdb-from-python">Invoke and control GDB from Python</a>. But they are more or less a solution for scripting gdb in python. Since I am going to use an arm-gdb to debug embedded program, I cannot enable python scripting in my gdb. </p>
  
  <p>My goal is to create a high-level abstraction of gdb. For example, launch gdb, set some breakpoints and continue within my code. I also read some material gdb/mi interface. But could anyone tell me how to use gdb/mi interface to create a gdb process and communicate with gdb from c/python code? (Luckily my arm-gdb supports gdb/mi interface).</p>