在Visual studio中调试C ++代码从eclipse中运行的python代码

在Visual studio中调试C ++代码从eclipse中运行的python代码

问题描述:

有没有人知道我们怎么做?
我在eclipse中有python代码,每当它调用c ++函数,我想要的断点去视觉工作室c ++项目。

Does any one know how we can do this? I have python code in eclipse and whenever it calls c++ functions, i want the break point to go to the visual studio c++ project.

您可以在visual studio中使用 __ debugbreak ,以便每次调用代码时触发调试器(您可能需要在MSDN中搜索函数)

You can use a __debugbreak in visual studio so that every time the code is invoked it triggers the debugger (you may want to search the function in MSDN).

将指令插入要调试的C ++函数(或类方法),例如

Insert the instruction in the C++ function (or class method) you want to debug, e.g.

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

运行python脚本,当库加载和代码执行时,一个messagebox出现告诉你是否要附加visual studio调试器。

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

它是旧的 __ asm {int 3} 的替代品。