This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Python debugging in gdb


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]