C ++ debug code in visual studio from python code running in eclipse

Does anyone know how we can do this? I have python code in eclipse and whenever it calls C ++ functions, I want the breakpoint to go to the visual studio C ++ project.

+4
source share
2 answers

You can use __debugbreak in the visual studio so that each time the code is called, it starts the debugger (you can search for the function in MSDN).

Insert the instruction into the C ++ function (or class method) that you want to debug, for example.

 void foo() { __debugbreak(); [...] } 

at this point, compile the library and run the python script, when the library loads and the code is executed, a message appears informing you if you want to attach a visual studio debugger.

This is a replacement for the old __asm { int 3 } .

+4
source

If a C ++ application works as a separate process, then this is pretty easy. You can start the process yourself or connect a visual studio to an existing running process and set breakpoints.

If C ++ code is an embedded DLL / LIB, you can use python as a debugging / launching process. Once python loads the DLL / LIB into your python code, visual studio will activate your breakpoints.

Alternatively, you can also add window debugger invocation calls to your code. Once your code is executed, you will see a dialog box asking if you want to attach the debugger.

+2
source

All Articles