远程调试可以解决程序依赖特定机型环境的问题,下面以VS 2005为例说明如何配置远程调试的环境。
1. 配置目标机
1)拷贝Remote Debugger客户端与目标程序的调试版本到目标机。
拷贝目录C:/Program Files/Microsoft Visual Studio 8/Common7/IDE/Remote Debugger/x86。
目标程序如C:/Windows/System32/Thpsvr.exe
2)执行Remote Debugger客户端程序msvsmon.exe。
首先关掉Windows防火墙。
运行程序后,选择[Tools]-[Options]。选择[No Authentication(native only)],并勾选[Allow any user to debug]。
2. 配置主机
1) 打开工程,选择调试模式。
由菜单依次选择[Project] [Properties] [Configuration Properties] [Debugging]。将Debugger to launch选为Windows Remote Debugger.
2) 配置Remote Debug参数。
[Remote Command] 设置为目标程序全路径,C:/Windows/System32/Thpsvr.exe。
[Command Arguments] 按需要为程序设置参数。
[Remote Server Name] 填入目标机的IP地址。
[Connection] 设为Remote with no Authentication(native only)
其它设置不需要改动。
客户机和主机配置都已经完成,接下来以和本机调试相同的方法进行调试就可以了。
如何使用VC进行远程调试(Remote Debug)
最新推荐文章于 2024-04-18 13:24:13 发布