Use Deblector to debug application to get pseudo source debugging experience
2008-12-30 19:08
309 查看
有的时候,你可能需要调试一段没有源代码的程序,或者说你有的时候想单步跟踪到.NET Framework里面的一些函数去看看为什么调用会失败。如果你这个需要的话,可以试一下Deblector,它将Reflector和mdbg.exe的威力结合起来为你提供次源代码级别的调试体验。
You may already have experiences with debugging an application without source code available, or failed to step into .NET framework code whiling debugging your program’s defects. In this case, you may try deblector, it combines the power of Reflector and mdbg.exe to supply pseudo source debugging experience.
你可以去下面这个地方下载deblector和Reflector:
Please download deblector and reflector from the following place:
Deblector: http://www.codeplex.com/deblector
Reflector: http://reflector.red-gate.com/
这里,我向你演示如何使用Deblector调试XamlPad.exe,假设你把Deblector解压到C:/Deblector文件夹。
In this article, I’ll try to show you how to debug XamlPad.exe by using Deblector. Let’s assume that you extract Deblector and save the bits in C:/Deblector folder.
1. 启动Reflector,单击菜单栏里面的“View”—“Add Ins”。
1. Launch reflector, and click “View” – “Add Ins” commands in the menu bar, which brings up “Add-Ins” dialog.
2. 在弹出的“Add Ins”对话框里面单击“Add”来加载Deblector插件。
2. Click “Add” button and select file “C:/Deblector/DeblectorAddIn/DeblectorAddIn/bin/Debug/DeblectorAddIn.dll”.
3. 下面是加载后的效果图:
3. The result should look like the following picture:
4. 关闭“Add Ins”对话框,接着单击Reflector菜单栏里面的“Tools”—“Deblector”来打开Deblector插件。
4. Close “Add-Ins” dialog. And click “Tools” – “Deblector” on Reflector’s menu bar. This will display Deblector’s UI.
5. 在Deblector里面的“Command”文本框里面输入mdbg命令r “C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin/XamlPad.exe”。千万不要忘记命令里面的r和引号,J
5. Enter command r “C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin/XamlPad.exe” in “Command” text box. DO NOT miss the leading “r” mdbg command and quotes. And then press enter.
6. 等XamlPad.exe启动以后,在Reflector左边的“Class Members”树里面找到“XamlPad.XamlPadPage.RefreshButtonClicked”函数双击参看它的代码。
6. After the XamlPad.exe is launched, navigate to Main method of XamlPad.exe in “Class Members” tree view in the left side of Reflector. Find “XamlPad.XamlPadPage.RefreshButtonClicked” method and double click it.
7. 在“Deblector”里面点击“Pause”按钮中断XamlPad的执行。
7. Click “Pause” button in “Deblector” window.
8. 切换到“IL View”窗口,在里面找到一行IL代码,通过按红色按钮,或者点击F9设置一个断点。现在你还只能在IL代码里面设置断点,不能直接在返回编出来的C#代码里面设置断点,因此你需要通过阅读Reflector反汇编的C#代码来猜测设置IL断点的位置。
8. In “IL view” tab in Deblector window, set a breakpoint in an appropriate position by clicking the red cycle button (or press F9 on keyboard), you can view the decompiled C# source code from “Disassembly” tab and guess while to set the breakpoint in “IL view” tab.
9. 断点设置好了以后,切断到XamlPad程序,点击“Refresh”按钮,这时触发断点,你可以在Deblector的“Auto”窗口查看一些局部变量的值,在“Call Stack”里面查看堆栈信息,通过“Module”窗口查看加载进来的Assembly,而“Quick View”窗口的功能和Visual Studio的“监视”窗口的功能是一样的。
9. Switch back to XamlPad.exe and click “Refresh” button. Then you can examine values of some variables in “Auto” window, call stacks in “Calls” window, and check the loaded modules in “Modules” window. The “Quick View” window provides similar functionalities like “Watch” window in visual studio 2008.
Enjoy it. :)
You may already have experiences with debugging an application without source code available, or failed to step into .NET framework code whiling debugging your program’s defects. In this case, you may try deblector, it combines the power of Reflector and mdbg.exe to supply pseudo source debugging experience.
你可以去下面这个地方下载deblector和Reflector:
Please download deblector and reflector from the following place:
Deblector: http://www.codeplex.com/deblector
Reflector: http://reflector.red-gate.com/
这里,我向你演示如何使用Deblector调试XamlPad.exe,假设你把Deblector解压到C:/Deblector文件夹。
In this article, I’ll try to show you how to debug XamlPad.exe by using Deblector. Let’s assume that you extract Deblector and save the bits in C:/Deblector folder.
1. 启动Reflector,单击菜单栏里面的“View”—“Add Ins”。
1. Launch reflector, and click “View” – “Add Ins” commands in the menu bar, which brings up “Add-Ins” dialog.
2. 在弹出的“Add Ins”对话框里面单击“Add”来加载Deblector插件。
2. Click “Add” button and select file “C:/Deblector/DeblectorAddIn/DeblectorAddIn/bin/Debug/DeblectorAddIn.dll”.
3. 下面是加载后的效果图:
3. The result should look like the following picture:
4. 关闭“Add Ins”对话框,接着单击Reflector菜单栏里面的“Tools”—“Deblector”来打开Deblector插件。
4. Close “Add-Ins” dialog. And click “Tools” – “Deblector” on Reflector’s menu bar. This will display Deblector’s UI.
5. 在Deblector里面的“Command”文本框里面输入mdbg命令r “C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin/XamlPad.exe”。千万不要忘记命令里面的r和引号,J
5. Enter command r “C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin/XamlPad.exe” in “Command” text box. DO NOT miss the leading “r” mdbg command and quotes. And then press enter.
6. 等XamlPad.exe启动以后,在Reflector左边的“Class Members”树里面找到“XamlPad.XamlPadPage.RefreshButtonClicked”函数双击参看它的代码。
6. After the XamlPad.exe is launched, navigate to Main method of XamlPad.exe in “Class Members” tree view in the left side of Reflector. Find “XamlPad.XamlPadPage.RefreshButtonClicked” method and double click it.
7. 在“Deblector”里面点击“Pause”按钮中断XamlPad的执行。
7. Click “Pause” button in “Deblector” window.
8. 切换到“IL View”窗口,在里面找到一行IL代码,通过按红色按钮,或者点击F9设置一个断点。现在你还只能在IL代码里面设置断点,不能直接在返回编出来的C#代码里面设置断点,因此你需要通过阅读Reflector反汇编的C#代码来猜测设置IL断点的位置。
8. In “IL view” tab in Deblector window, set a breakpoint in an appropriate position by clicking the red cycle button (or press F9 on keyboard), you can view the decompiled C# source code from “Disassembly” tab and guess while to set the breakpoint in “IL view” tab.
9. 断点设置好了以后,切断到XamlPad程序,点击“Refresh”按钮,这时触发断点,你可以在Deblector的“Auto”窗口查看一些局部变量的值,在“Call Stack”里面查看堆栈信息,通过“Module”窗口查看加载进来的Assembly,而“Quick View”窗口的功能和Visual Studio的“监视”窗口的功能是一样的。
9. Switch back to XamlPad.exe and click “Refresh” button. Then you can examine values of some variables in “Auto” window, call stacks in “Calls” window, and check the loaded modules in “Modules” window. The “Quick View” window provides similar functionalities like “Watch” window in visual studio 2008.
Enjoy it. :)
相关文章推荐
- Use Pseudoregisters to debug in MSVC++
- Open debug mode for Tomcat and use Eclipse to remote debug the application
- How to use the HTML source for debugging issues
- MTK use GDB to debug KE by get break point in file
- #146 – Use GetValueSource Method to Find the Source of a Dependency Property Value
- [Angular 2] How To Debug An Angular 2 Application - Debugging via Augury or the Console
- How to use eclipse to debug android source(from google official site)
- Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in
- use cmd's /l* <logfile> to get its log.
- Configuring Visual Studio to Debug .NET Framework Source Code
- [c#] How to use Data Access Application Block?
- Jboss7报错ARJUNA016037: Could not find new XAResource to use for recovering...的解决办法
- Two little classes to easily get pseudo-random numbers
- 远程调试 ERROR: JDWP unable to get necessary JVMTI capabilities. ["debugInit.c",L279]
- Eclipse运行Android程序报Error generating final archive: Unable to get debug signature key错误解决方法
- How to use fb.data.query to get friends info?
- guard class ,can extend to debug by add errorline number when use this check
- How to debug Android Native Application with eclipse
- How to Use the Visual Studio .NET Application Center Test
- IDEA 编译错误:java: try-with-resources is not supported in -source 1.6 (use -source 7 or higher to enable try-with-resources)