How to: Launch the Debugger Automatically
来源:互联网 发布:淘宝手机图片尺寸大小 编辑:程序博客网 时间:2024/05/26 05:52
How to: Launch the Debugger Automatically
- Visual Studio 2010
- .NET Framework 3.0
- Visual Studio 2005
- Visual Studio .NET 2003
Sometimes, you may need to debug the startup code for an application that is launched by another process. Examples include services and custom setup actions. In these scenarios, you can have the debugger launch and automatically attach when your application starts.
To setup an application to launch the debugger automatically
Start the Registry Editor (regedit).
In the Registry Editor, open the HKEY_LOCAL_MACHINE folder.
Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\currentversion\image file execution options.
In the Image File Execution Options folder, locate the name of the application you want to debug, such asmyapp.exe. If you cannot find the application you want to debug:
Right-click the Image File Execution Options folder, and on the shortcut menu, clickNew Key.
Right-click the new key, and on the shortcut menu, click Rename.
Edit the key name to the name of your application; myapp.exe, in this example.
Right-click the myapp.exe folder, and on the shortcut menu, clickNew String Value.
Right-click the new string value, and on the shortcut menu, click Rename.
Change the name to debugger.
Right-click the new string value, and on the shortcut menu, click Modify.
The Edit String dialog box appears.
In the Value data box, type vsjitdebugger.exe.
Click OK.
From the Registry menu, click Exit.
The directory containing vsjitdebugger.exe must be in your system path. To add it to the system path, follow these steps:
Open the Control Panel in Classic view, and double-clickSystem.
Click Advanced System Settings.
In System Properties, click the Advanced tab.
On the Advanced tab, click Environment Variables.
In the Environment Variables dialog box, under System variables, select Path, then click the Edit button.
In the Edit System Variable dialog box, add the directory to theVariable value text box. Use a semicolon to separate it from other entries in the list.
Click OK to close the Edit System Variable dialog box.
Click OK to close the Environment Variables dialog box.
Click OK to close the System Properties dialog box.
Now, use any method to start your application. Visual Studio will start and load the application.
注册表例子
Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\showcmd999.exe]"Debugger"="\"D:\\OllyICE_1.10_byPediy_GoodOnWin7X64\\OllyICE.exe\""
作用
当我们打开(双击或CreateProcess) showcmd999.exe时, OllyICE.exe会接住程序, 附加并调试.
- How to: Launch the Debugger Automatically
- How to Use the Visual C++ DEBUGGER
- How to logon windows automatically
- (转)How to build adb, the Android debugger
- How to execute the script automatically without the authority of /etc
- How to generate attribute sets automatically?
- How to Login Automatically in PI3
- How to launch application to start->run
- Gnome-terminal, How to Copy selection to clipboard automatically?
- How to use bindings-generator to generate lua binding automatically
- How to solve the emulator -5554 disconnected! Cancelling 'package name.class name activity launch'!
- How to launch terminal Window in Fedora
- How to failover automatically in windows server 2008 failover cluster
- How to implement double interfaces by IDispatch automatically basing MFC
- how to start service automatically in ubuntu10.0.4
- How to Login Automatically into Website Using Excel VBA
- How to Add An Automatically Executable Program in YOCTO?
- Automatically attaching a debugger to a process every time it is launched
- Android发带附件和图片的邮件
- 新浪微博客户端新特性滚动视图和启动界面实现
- unity3d动画插件iTween-路径动画的制作
- 手机CPU处理器大解析
- servlet是不是单例的?
- How to: Launch the Debugger Automatically
- syk几乎走到专线
- php处理提交表单中的换行,把提交内容中的换行转换成数组
- 人际交往
- Class.getSimpleName()的作用
- 12306 火车票订票助手
- 儿子和女儿——解释器和编译器的区别与联系
- [转载]Linux 引导过程内幕
- EXT2.3.0实现按钮动态改变tooltip