Wednesday, June 7, 2006

Stopping in a C++ function called via Python

How do i tell totalview to stop at a line number in a particular file? This is a C++ function in a SO which is being loaded as part of a python import.

Leaf Nunes has the most awesome answer:
I 'm not sure how you tell totalview via totalview, but you can tell the C++ to stop at a line by adding:
asm("int $3");
This is the only way i've seen to pre-set a breakpoint in C code referenced by a python binary running under totalview. Once it's stopped, you should be able to look around all the libraries the python binary has loaded and set breakpoints as you desire.
Arun Rao:
If you run the python program until it finishes, then you can set the breakpoint because the library will have been loaded, and restart the process.

No comments: