[英]Automating DLL Debugging “attach to process” in Visual Studio?
I'm writing an SNMP extension agent DLL for Windows. 我正在为Windows编写SNMP扩展代理DLL。
Is there a way to automatically attach the DLL to the SNMP service each time I want to test/debug? 是否有一种方法可以在每次我要测试/调试时自动将DLL附加到SNMP服务?
This is a very tedious and time consuming process, as I currently have to stop the SNMP service, compile, restart the service and then attach the process. 这是一个非常繁琐且耗时的过程,因为我目前必须停止SNMP服务,进行编译,重新启动该服务,然后附加该过程。 I'm trying to automate it more.
我正在尝试使其更加自动化。
This may be what you want to have a look at. 这可能是您想要看看的。
Visual Studio debugger offers some command line option to attach to running process. Visual Studio调试器提供了一些命令行选项以附加到正在运行的进程。 You can probably write a Python script to enumerate running processes and attach the debugger to the service.
您可能可以编写Python脚本来枚举正在运行的进程并将调试器附加到服务。 I think you need admin priviledge to do that.
我认为您需要管理员权限才能执行此操作。
.Net has a convinient Debugger.Launch(), but I can't find an equivalent for the native. .Net有一个方便的Debugger.Launch(),但我找不到与本机等效的产品。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.