【问题标题】:How to check whether debugger of Python Tools for Visual Studio is attached to current process?如何检查 Python Tools for Visual Studio 的调试器是否附加到当前进程?
【发布时间】:2012-03-28 14:45:12
【问题描述】:

如何检查 Python Tools for Visual Studio 2010 的调试器是否附加到当前进程?

IsDebuggerPresentCheckRemoteDebuggerPresent 函数不起作用,但 Visual Studio 2008 可以说它已经在调试。 VS2008 是否使用一些 DTE 方法来实现这一点(枚举 VS 的运行版本,包括旧版本和未来(???)版本,并检查它是否已经调试过......?)或者它使用了我可以在里面使用的其他方式我的申请?

注意:事实证明,WinDbg 允许附加到此进程,因此如果您需要同时调试 C++ 和 Python,您可以尝试直到解决 this issue

【问题讨论】:

    标签: python visual-studio ptvs


    【解决方案1】:

    你问的不是和这里的同一个问题:How do I check if the python debug option is set from within a script 吗?那里建议的sys.flags.debug 对我有用。 可悲的是,我对调试 Cpython 解释器的内部了解不多。我只猜你用过那个,可能是ctypes

    【讨论】:

    • sys.flags.debug 对我不起作用,但sys.flags.dont_write_bytecode 对我有用,我想是因为调试器关闭了字节码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-27
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 2012-01-11
    相关资源
    最近更新 更多