Debug Analyzer.NET - Debug Analyzer Intelligent Debugger http://debuganalyzer.net/ http://www.rssboard.org/rss-specification BlogEngine.NET 1.6.0.5 en-GB http://debuganalyzer.net/opml.axd http://www.dotnetblogengine.net/syndication.axd Sukesh Debug Analyzer.NET 0.000000 0.000000 Video Tutorial <p>Let us see different features in action in <span style="color:#ff0000"><strong>5 min</strong> to fame style</span> screencast...!</p> <p>&nbsp;</p> <div>[vimeo:18995935]</div> http://debuganalyzer.net/post/Video-Tutorial.aspx Sukesh http://debuganalyzer.net/post/Video-Tutorial.aspx#comment http://debuganalyzer.net/post.aspx?id=d934b5fb-36d1-4811-9db9-05293c3013b2 Sun, 02 Jan 2011 04:13:00 -0500 Analysis Debug Analyzer Learn Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=d934b5fb-36d1-4811-9db9-05293c3013b2 0 http://debuganalyzer.net/trackback.axd?id=d934b5fb-36d1-4811-9db9-05293c3013b2 http://debuganalyzer.net/post/Video-Tutorial.aspx#comment http://debuganalyzer.net/syndication.axd?post=d934b5fb-36d1-4811-9db9-05293c3013b2 How Learn Mode Works? <p>One of the core idea behind Debug Analyzer.NET is to aid in learning Debugging and also about the issues it detects.</p> <p>Learn mode is a way for the analysis results to provide articles or other resource links which would help in understanding the issue better and also get guidance on how to avoid such issues in future.<br />Let us see how it looks like in a sample report.</p> <p><img style="border: 1px solid black;" src="/image/2011/1/LearnMode-i.png" alt="" /></p> <p>The icon <img src="/image/2011/1/the-i.png" alt="" />&nbsp;is a clickable link to resource article related to the issue. In this case it's the result of the following code in the analysis plug</p> <pre class="brush: csharp;">WriteRecommendation(ResultSeverity.Error, "You have hit a performance bottle-neck related to Throttling [LM60001] " + (capacity == 16 ? " (due to very low default value on .NET 3.0)" : ""), "Please change the values of maxConcurrentCalls as per suggestion"); </pre> <p>&nbsp;</p> <h4>What are the different formats for Learn Mode articles ?</h4> <pre class="brush: text;">Learn Mode Articles - [LM&lt;learnId&gt;] eg. [LM50000] Microsoft KB - [KB&lt;articleId&gt;] eg. [KB123456] Microsoft Bulletins - [&lt;bulletinId&gt;] eg. [MS10-049] </pre> <p>&nbsp;</p> <h4>How to get the list of Learn Mode Articles?</h4> <p><strong>http://go.debuganalyzer.net</strong></p> <p><img style="border: 1px solid black;" src="/image/2011/1/go-da.png" alt="" /></p> http://debuganalyzer.net/post/How-Learn-Mode-Works.aspx Sukesh http://debuganalyzer.net/post/How-Learn-Mode-Works.aspx#comment http://debuganalyzer.net/post.aspx?id=72950f74-0875-4509-94c1-d7a336b3ecd1 Sun, 02 Jan 2011 03:13:00 -0500 Analysis Debug Analyzer Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=72950f74-0875-4509-94c1-d7a336b3ecd1 0 http://debuganalyzer.net/trackback.axd?id=72950f74-0875-4509-94c1-d7a336b3ecd1 http://debuganalyzer.net/post/How-Learn-Mode-Works.aspx#comment http://debuganalyzer.net/syndication.axd?post=72950f74-0875-4509-94c1-d7a336b3ecd1 How Instant Analyzer works? <p>Instant Analyzer is more like SQL Query Analyzer, you write your analysis and hit F5 ("Compile &amp; Execute")&nbsp;and it shows the results in the window below.<br />You can also save and load snippets, which&nbsp;are saved and kept under the 'snippets' folder. The 2nd icon for loading and 3rd icon for saving.</p> <p>The following things happen when you hit F5 or "Compile &amp; Execute"</p> <ul> <li>Complete&nbsp;Analysis Plug source is generated&nbsp;by merging the source&nbsp;in the Code Editor&nbsp;below</li> <li>The Analysis Plug is compiled (C# for now) to generate an in-memory Analysis Plug (assembly)</li> <li>Plug Framework evaluates the Analysis Plug to get the Attributes</li> <li>In-memory Plug is then instantiated and Invoked&nbsp;by the Debug Analyzer Engine</li> <li>Debug Analyzer Engine invokes the Data Access Component for the relevant Data</li> <li>Uses the Debugger to get the required data from memory dump&nbsp;requested by the Plug</li> <li>Executes the Entry-point function of the Plug and generates the HTML report content</li> <li>Debug Analyzer Engine gives back the HTML report content</li> <li>Report window at the bottom, shows the HTML report content</li> </ul> <p>Below&nbsp;screenshot shows powerful reporting capability with Graph to display Top 5 .NET Heaps details.<br /><img src="/image/2011/1/InstantAnalyzer-HeapGraph.png" alt="" /></p> <p>&nbsp;</p> <p>Below screenshot shows powerful Analysis capabilities using <span style="color:#0000ff">.NET Lambda expression syntax</span><br /><img src="/image/2011/1/InstantAnalyzer-HeapGraph1.png" alt="" /></p> <p>The above snippets are already included in the download.</p> <p>VB.NET support and <span style="color:#0000ff">'Compile and Publish'</span> option coming soon... <br /><span style="color:#0000ff">'Compile and Publish'</span> option would allow you to convert snippet into Analysis Plug directly with the click of a button.</p> http://debuganalyzer.net/post/InstantAnalyzer.aspx Sukesh http://debuganalyzer.net/post/InstantAnalyzer.aspx#comment http://debuganalyzer.net/post.aspx?id=5a2c24db-e55d-465a-9cab-b25e06e06d33 Sun, 02 Jan 2011 02:13:00 -0500 Analysis Debug Analyzer Snippets Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=5a2c24db-e55d-465a-9cab-b25e06e06d33 0 http://debuganalyzer.net/trackback.axd?id=5a2c24db-e55d-465a-9cab-b25e06e06d33 http://debuganalyzer.net/post/InstantAnalyzer.aspx#comment http://debuganalyzer.net/syndication.axd?post=5a2c24db-e55d-465a-9cab-b25e06e06d33 How Interactive Debugging Works? <p>Interactive Debugging feature provides a way for you to manually debug the memory dumps like you do normally. It also provides a way to save the output in RTF format so that you can use it for reference later.</p> <p>The main benefit of Interactive Debugging is that it enables you to&nbsp;create .NET based commands, equivalent to Debugger Extension commands called 'Command Plugs'.<br />This feature is still work-in-progress so currently this feature supports only basic debugger commands.</p> <p><img src="/image/2011/1/InteractiveDebugger.png" alt="" /></p> <p>More features in the pipeline... hold your thoughts!</p> <p>&nbsp;</p> http://debuganalyzer.net/post/How-Interactive-Debugging-Works.aspx Sukesh http://debuganalyzer.net/post/How-Interactive-Debugging-Works.aspx#comment http://debuganalyzer.net/post.aspx?id=75769bf7-424f-4276-bd0b-0264c9eaa669 Sun, 02 Jan 2011 02:13:00 -0500 Debug Analyzer Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=75769bf7-424f-4276-bd0b-0264c9eaa669 0 http://debuganalyzer.net/trackback.axd?id=75769bf7-424f-4276-bd0b-0264c9eaa669 http://debuganalyzer.net/post/How-Interactive-Debugging-Works.aspx#comment http://debuganalyzer.net/syndication.axd?post=75769bf7-424f-4276-bd0b-0264c9eaa669 Frequently Asked Questions! <p>I have addressed few questions below, but if you have any&nbsp;other questions or concerns, feel free to ask through comments.</p> <div id="faq"> <h4>Q. If I throw a Kitchen sink at Debug Analyzer.NET, will it analyze it for me?</h4> <div> <p>Kitchen sink is not supported at this time.</p> </div> <h4>Q. Can we use Debug Analyzer.NET to do live debug?</h4> <div> <p>Debug Analyzer.NET is a memory dump analysis tool and does not support Live debugging. It's a non-technical decision since you already have tools like Visual Studio, Windbg etc available for that.</p> </div> <h4>Q. Can we use Debug Analyzer.NET for debugging native memory dumps?</h4> <div> <p>Current version of Debug Analyzer.NET supports analysis for .NET and few related commands from native world under Analyzer.DBG. Support for Native scenarios will be provided as and when required. This would be more to help the managed debugging rather than full fledged native support for now.</p> </div> <h4>Q. What versions of CLR are supported by Debug Analyzer.NET?</h4> <div> <p>Current version of Debug Analyzer.NET supports analysis for CLR v2 (and 3.x). CLR v4 support is coming soon after the initial release. Silverlight support is also planned.</p> </div> <h4>Q. Will Debug Analyser.NET support CLR 1.x memory dumps?</h4> <div> <p>There are no plans to support .NET 1.x since its usage is very low and not worth my personal time.</p> </div> <h4>Q. If I write Analysis Plug, how do I get credit for the usage?</h4> <div> <p>Analysis Reporting Framework uses Plug 'Assembly Attribute' called 'Company' to show Author name in the Plug footer. You can add your name or website to show up as Author there (no HTML).</p> </div> <h4>Q. Why is Debug Analyzer.NET current release numbered as V2?</h4> <div> <p>There was a V1 version of Debug Analyzer.NET which was released to showcase the idea of how analysis can be done using Plug Framework. Current version is improved with a redesign of the architecture, implementing a Provider Model and Data Access Components. Also several features were added, one of them being Instant Analysis.</p> </div> <h4>Q. After completion of Debug Analyzer.NET v2, then what?</h4> <div> <p>I have a complete roadmap prepared for v3 and would love to continue working on it. I will be publishing the roadmap sometime in the future.</p> </div> <h4>Q. Does Debug Analyzer.NET contain bugs?</h4> <div> <p>You bet, it would have bugs since it's built by human (yours truly). I have also provided Diagnostic Tracing, configured through config file to get more information about the bugs, as and when it happens.</p> </div> <h4>Q. What is the easy way to learn to write Analysis Plugs?</h4> <div> <p>I'll be blogging more about analysis with samples as snippets which you can use from Instant Analyzer. Also all the built-in Analysis Plugs source would be shared through Codeplex project for your learning pleasure. Since the flow of the Analysis is same as what we do manually, you can learn debugging in Windbg with sos/psscor if you know how to write Analysis and vice versa.</p> </div> </div> http://debuganalyzer.net/post/faq.aspx Sukesh http://debuganalyzer.net/post/faq.aspx#comment http://debuganalyzer.net/post.aspx?id=13bea429-e5e4-4c21-9be1-37dd552c5fe2 Sat, 01 Jan 2011 03:13:00 -0500 Debug Analyzer Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=13bea429-e5e4-4c21-9be1-37dd552c5fe2 0 http://debuganalyzer.net/trackback.axd?id=13bea429-e5e4-4c21-9be1-37dd552c5fe2 http://debuganalyzer.net/post/faq.aspx#comment http://debuganalyzer.net/syndication.axd?post=13bea429-e5e4-4c21-9be1-37dd552c5fe2 How to Run Analysis? <p>One of the core features of Debug Analyzer.NET is to run Analysis on the memory dumps and provide a friendly report to show you the details in dumps, issues detected and recommendations for resolving those issues. This is accomplished by using a modular approach using Analysis Plugs. The Analysis Plugs are then grouped into what are called "Analysis Templates" according to the scenarios or issues we are troubleshooting.</p> <p>Let us see how the "Analysis Templates" are shown on the left side of the main screen.</p> <p><img style="border: 1px solid black;" src="/image/2011/1/AnalysisTemplateSelection.png" alt="" /></p> <p><span style="color:#0000ff">How do you Run Analysis?</span><br />So when you want to run analysis, you need to select a memory dump and select one of these "Analysis Templates" and click on "Run Analysis". <br />Each sub element shown under the Template Name (highlighted in blue) are individual Analysis Plugs. <br />Please see the article titled "Hello World Analysis Plug" on the&nbsp;right&nbsp;for learning to write your Analysis Plugs.</p> <p><span style="color:#0000ff">How do you create Analysis Template?</span><br />From the top menu click Tools &gt; Analysis Templates. You can get the following screen where you can edit your Templates.</p> <p><img src="/image/2011/1/AnalysisTemplates.png" alt="" /></p> <p>&nbsp;</p> http://debuganalyzer.net/post/How-to-Run-Analysis.aspx Sukesh http://debuganalyzer.net/post/How-to-Run-Analysis.aspx#comment http://debuganalyzer.net/post.aspx?id=574acb54-7e8e-4677-b631-e55dc18d85ef Sat, 01 Jan 2011 02:13:00 -0500 Analysis Debug Analyzer Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=574acb54-7e8e-4677-b631-e55dc18d85ef 0 http://debuganalyzer.net/trackback.axd?id=574acb54-7e8e-4677-b631-e55dc18d85ef http://debuganalyzer.net/post/How-to-Run-Analysis.aspx#comment http://debuganalyzer.net/syndication.axd?post=574acb54-7e8e-4677-b631-e55dc18d85ef How Application Update works? <p>Let's&nbsp;see step-by-step how the Application Update works with screenshots. Keep in mind at this time you need to manually trigger the update process. <br />And this would be the case during the Beta timeframe.</p> <p><img src="/image/2011/1/AppUpdate-1.png" alt="" /><br />Use Help &gt; Check for Updates... option</p> <p>&nbsp;</p> <p><img src="/image/2011/1/AppUpdate-2.png" alt="" /><br />Notify about the newer version availability</p> <p>&nbsp;</p> <p><img src="/image/2011/1/AppUpdate-3.png" alt="" /><br />Downloading the Updates</p> <p>&nbsp;</p> <p><img src="/image/2011/1/AppUpdate-4.png" alt="" /><br />Updates downloaded and ready to be applied.</p> <p>&nbsp;</p> <p><img src="/image/2011/1/AppUpdate-5.png" alt="" /><br />Updates installed and ready to launch the newer version</p> <p>&nbsp;</p> <p><img src="/image/2011/1/AppUpdate-6.png" alt="" /><br />Verify the Version number from Help &gt; About</p> http://debuganalyzer.net/post/AppUpdate.aspx Sukesh http://debuganalyzer.net/post/AppUpdate.aspx#comment http://debuganalyzer.net/post.aspx?id=826eb6b6-14e1-48c9-a817-5cc3e3ff08c4 Sat, 01 Jan 2011 02:13:00 -0500 Debug Analyzer Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=826eb6b6-14e1-48c9-a817-5cc3e3ff08c4 0 http://debuganalyzer.net/trackback.axd?id=826eb6b6-14e1-48c9-a817-5cc3e3ff08c4 http://debuganalyzer.net/post/AppUpdate.aspx#comment http://debuganalyzer.net/syndication.axd?post=826eb6b6-14e1-48c9-a817-5cc3e3ff08c4 Architecture & Design <p>From my experience as a developer&nbsp;I have seen&nbsp;a lot of great applications from architecture perpsective. One of those things which is often left out and comes as last&nbsp;is the application extensibility&nbsp;and developer experience.&nbsp;This leads to either complicated configuration settings or a huge learning curve to accomplish simplest of things.</p> <p>When I started building this application, I had few guidelines and I worked backwards in many things to make developing experience more easier (still learning to do more though...).<br />One of the best things to happen in Developer world is the intellisense support. It is more like copy/paste of the&nbsp;developer world and I wanted to make sure I use that in the best possible ways.</p> <p style="color:#000000"><strong>Design Thoughts</strong></p> <ul> <li><span style="color:#0000ff">Write Analysis just once and it works for both x86 and x64</span><br />Debug Analyzer built-in framework abstracts away the Data Access, so your Analysis just works without changes on x86 &amp; x64 targets since it's written against the Object Model and have no dependency on processor architecture of the memory dumps.</li> <li><span style="color:#0000ff">Plug Framework</span><br />This framework allows the flexibility of dropping a DLL in designated folder and the application consuming it. Makes it easier for writing analysis with little or no learning curve. This framework is used in all core features like Analysis Plug, Command Plug, Visualizer Plug etc...</li> <li><span style="color:#0000ff">Analysis Workflow</span><br />Enabling developers to learn debugging memory dumps was one of the requirements and this is achieved by having the flow of analysis plugs follow almost the same pattern of how you do manually using windbg and sos/psscor. This enables you to do both, write analysis if you know how to debug using windbg + sos/psscor and vice versa.</li> <li><span style="color:#0000ff">Object Model</span><br />Build a Object Model heirarchy which is consistent and easy to discover in a heirarchical manner. This is implemented with the Analyzer Object Model heirarchy. It also uses intellisense to show you the entire heirarchy and smooth flow.</li> <li><span style="color:#0000ff">Extensibility with Abstraction layers</span><br />Designed as a tiered application with extensibility to replace components through config using abstraction layers. Analysis Engine can be called by passing simple parameters. Data Access Components can be replaced by just changing it in config file, specially if you want to change the data source.</li> <li><span style="color:#0000ff">API is contained in single DLL (Debug.Analyzer.API)</span><br />Whatever you do, you set reference only to a single DLL, whether it's to write Plugs, Tracing, DAC or anything else.</li> <li><span style="color:#0000ff">Reporting Framework</span><br />Reporting Framework handles look and feel completely using XML/XSL. This was done to make sure there is a structured way for reporting and also enables to change the look and feel of the reports without rewriting or recompiling the Plugs.</li> <li><span style="color:#0000ff">Reduced footprint.</span><br />Since entire Windows Debugging Tools is a larger download, Debug Analyzer uses MSDN documented COM interfaces to interact with the memory dumps and use sos/psscor to extract data relevant to CLR. Moving to .NET Framework 4.0 was also done to reduce the number of prerequisites!</li> <li><span style="color:#0000ff">Better resources to educate.</span><br />Learn mode plays a major role in educating developers on what the issue was and how it can be avoided by explaining the reasons in detail for the issue. Often times, analysis results comes with complicated terminologies assuming everyone are aware of the said terminologies. Learn option enables developers to get more information about the said problem and gain knowledge to make sure the mistakes are not repeated.</li> </ul> <p><img src="/image/2011/1/Architecture.png" alt="" /><br />Simplistic looks at the different component layers</p> <p><span style="color:#000000"><strong>How it works!</strong><span><br />Here is the flow of events which happens when you click 'Run Analysis'</span></span></p> <ul> <li>Calls Debug Analyzer Engine with the 'Analysis Template' name and the memory dump file details </li> <li>The Engine loads all the Analysis Plugs which are part of the specific Template </li> <li>Instantiates each individual Plug and run the code using the entry point 'RunAnalysis' </li> <li>On 1st use Plug Framework invokes the Input Provider which is part of Provider Framework </li> <li>Provider Framework does lookup in the config and loads/instantiates the relevant Data Access Component </li> <li>Provider Framework also does caching inside the Object Model on 1st load of the Collections&nbsp;to make the analysis faster </li> <li>Data Access Component has the complete logic of how the the data is extracted out of the Data Source which are memory dumps (for now) </li> <li>Reporting Framework captures the output generated in XML form and returns the Analysis fragment for each Plug </li> <li>After all the Plugs have returned, the individual fragments are used by Reporting Framework with built-in XSL to generate output HTML </li> <li>Writes the output to Reports folder and Shows the generated report in the main application. </li> </ul> <p style="color:#000000">There were few challenges as well&nbsp;which are&nbsp;explained below.</p> <p><span style="color:#0000ff">Challenge #1 - Textual output from Debugger and Extensions</span><br />Debugger Engine (dbgeng) works great for manually debugging and analyzing issues but when&nbsp;you want to build automation&nbsp;for&nbsp;debugging,&nbsp;textual output from the debugger becomes difficult to use. None of the debugger extensions provide alternate output which can be consumed for automation easily.</p> <p>This became a challenge specially since this is also true with Debugger extensions like sos/psscor used for .NET debugging. Writing an extension with all the features does not make too much sense, since that would also involve keeping things upto date with the changes in CLR etc. So the best alternative was to use the debugger output from sos/psscor and parse the string output.</p> <p>This introduces a question, what happens when the debugger extension changes the output format. Do I need to change my analysis as well? The answer to that was to build a Data Access Component abstraction layer so that Analysis is written against the Object Model and the underlying data can be changed without breaking them. This also helps in changing from SOS strings as it is used today to probably use ICorDebug later, all these done without breaking the existing Analysis already written.</p> <p><span style="color:#0000ff">Challenge #2 - Debugger (dbgeng) redistribution and the version in the OS</span><br />Debugger Engine which provides all the debugger functionality is contained in a DLL called dbgeng. This is distributed with the OS but not regularly updated. The latest updates come with the 'Windows Debugging Tools' package. Since the size of this package is larger, it becomes a larger download dependency for a simple&nbsp;application like Debug Analyzer.NET</p> <p>Best choice was to use the version of the Debugger Engine available in the OS and use the COM based interface as documented on MSDN. This is implemented at the Data Access Component layer which is written in C++/CLI.</p> <p>[Note: If you have any questions/concerns/feedback you can reach out to me through comments or Contact page ]</p> http://debuganalyzer.net/post/Architecture.aspx Sukesh http://debuganalyzer.net/post/Architecture.aspx#comment http://debuganalyzer.net/post.aspx?id=5f91782e-ecb0-41a8-a505-3ad65fc39a60 Sat, 01 Jan 2011 01:13:00 -0500 Debug Analyzer Sukesh http://debuganalyzer.net/pingback.axd http://debuganalyzer.net/post.aspx?id=5f91782e-ecb0-41a8-a505-3ad65fc39a60 0 http://debuganalyzer.net/trackback.axd?id=5f91782e-ecb0-41a8-a505-3ad65fc39a60 http://debuganalyzer.net/post/Architecture.aspx#comment http://debuganalyzer.net/syndication.axd?post=5f91782e-ecb0-41a8-a505-3ad65fc39a60