[C++-sig] Re: Boost.Python type registry

Giovanni Beltrame jumpjoe at fastwebnet.it
Mon Oct 8 10:48:07 CEST 2007

On Friday 05 October 2007 20:46:26 Ralf W. Grosse-Kunstleve wrote:

> BTW: What you need seems very unusual. Could you explain the situation?
> Did you consider alternative approaches?

The situation is definitely unusual, but I will try to explain.

I have a simulator that uses a C++ kernel and a bunch of simulation 
components. Now I want to wrap both kernel and components and add scripting 
and inspection functionality in Python. Python will be used to instantiate 
the simulation components and run what I will call the "architecture".
So far, so good, I have everything wrapped.

The problem is that I might want to debug the architecture. I was thinking of 
using GDB, but since components are instantiated in Python (note that I might 
have more objects that belong to one class), it is hard to get a reference to 
them. Setting a breakpoint on the source code is be easy, but putting a watch 
on a variable is much more tricky.

In the end what I would like to have is a sort of python-controlled GDB 
breakpoint mechanism, where I set a condition in python and C++ is stopped 
when the condition arises.
Getting a reference to the object/variable should be enough to put a watch in 
GDB (and here's why I'm trying to pass from PyObject to the C++ address).

Any suggestion is welcome!

Giovanni Beltrame
TEC-EDM Research Fellow
European Space Agency

More information about the Cplusplus-sig mailing list