在Visual studio中调试C ++代码从eclipse中运行的python代码 [英] Debug C++ code in visual studio from python code running in eclipse

查看:220
本文介绍了在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} 的替代品。

这篇关于在Visual studio中调试C ++代码从eclipse中运行的python代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆