擅长:python、mysql、java
<p>如果您有可用的Microsoft Visual Studio</p>
<p>1)打开DLL所属的Visual Studio项目(或创建新项目)。在</p>
<p>2)如果您已经设置了用于调试的DLL(您已经用调试信息构建了它,并且它将是您的python程序将使用的),那么您可以在DLL代码中设置断点。在</p>
<p>3)像平常一样启动要调试的程序。在</p>
<p>4)返回到visualstudioide并转到<code>Debug</code>菜单。选择<code>Attach to Process</code>选项。然后您将获得所有正在运行的进程的列表。在</p>
<p>5)选择要调试的进程,即python程序或运行程序的运行时。在</p>
<p>6)坐下来等待某个断点被击中,或者您可以尝试从“调试”菜单中使用<code>Break All</code>来暂时停止程序。在</p>
<p>这是一种通用的方法,不仅可以调试python程序,还可以调试任何需要调试程序正在使用的DLL的程序。在</p>
<p>请注意,如果您已经使用调试信息构建了DLL,并且正在被python应用程序使用,那么上面的建议最有效。如果它是一个没有源代码的第三方DLL,则仍然可以从visualstudio进行调试,但需要了解汇编语言(因为源代码通常不可用)。在</p>