This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Python debugging in gdb
- From: Dov Grobgeld <dov dot grobgeld at gmail dot com>
- To: gdb at sourceware dot org
- Date: Mon, 10 Sep 2012 12:50:09 +0300
- Subject: Python debugging in gdb
- References: <CA++fsGETsLexTGaaV3skfKi4znnsWBqYo-h4sothrkuREFnCxw@mail.gmail.com>
I would like to write some glue functions that allow debugging python
code within gdb. We have an embedded environment that in the call
stack calls back and forth between C++ and python multiple times. It
would be great if it was possible to debug this system in a single
environment.
To do this, I would like to define the following gdb commands:
py-break : Create a break point at line in a python file.
py-step: Step the next python statement.
py-next : Run the next python statement.
py-finish: Finish the current python function.
In a way this would create a relationship between python and C similar
to the current difference between step and stepi, where the former
steps in the compiled language and the latter in assembler language.
So for python I would like to have one higher abstraction layer.
(It would make sense to create a dispatcher that does `py-break` on a
python file and `break` on a C++ file so you can always use the same
command to create break points.)
Is this feasible? Can someone give me some ideas and pointers of how
to go about implementing this?
Regards,
Dov