{"id":186294,"date":"2011-05-20T14:56:42","date_gmt":"2011-05-20T14:56:42","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/research\/msr-research-item\/debugger-canvas-demo\/"},"modified":"2017-07-20T09:28:12","modified_gmt":"2017-07-20T16:28:12","slug":"debugger-canvas-demo","status":"publish","type":"msr-video","link":"https:\/\/www.microsoft.com\/en-us\/research\/video\/debugger-canvas-demo\/","title":{"rendered":"Debugger Canvas demo"},"content":{"rendered":"<div class=\"asset-content\">\n<p>This is a quick demo of Debugger Canvas, a new power tool for Visual Studio that rethinks the debugging experience. To see it in action, let\u2019s go after a bug in this web app for buying toys.<\/p>\n<p>As you can see I\u2019ve already got one model plane in my shopping cart. When I add the plane again to the shopping cart, I expect to have two items, but I only have one. That\u2019s the bug.<\/p>\n<p>To investigate this bug, I\u2019ll set a breakpoint in the method that adds items to the shopping cart. Let\u2019s go back to our app and add the item again to trigger the breakpoint.<\/p>\n<p>Now we\u2019re getting our first look at Debugger Canvas. Instead of breaking in a file, Debugger Canvas creates a code bubble to focus my attention on the one method where the break occurred. As I step through the code, Debugger Canvas creates a new bubble for each method that runs.<\/p>\n<p>Now I can see my whole call stack side-by-side. This makes some common tasks really easy. For example, if I\u2019m wondering where this product parameter came from, I can glance my way up the call stack. I can see it got passed as a parameter here and here, and here\u2019s where it originates, with this assignment. I didn\u2019t have to click my way all over the files to find out, I could just read the code across the screen.<\/p>\n<p>Each code bubble is a full-blown Visual Studio editor, with all the features you\u2019re familiar with. For example, I can look at tool tips to see values. I can set and clear breakpoints by clicking in the margin. There are also a few handy new features. Each code bubble has button in the corner that brings up the local variables for that method. By opening these up, I can see all the objects at are in play for the whole call stack. At any point, I can also save a copy of the current values of the variables. That way, as objects change state, I can compare the new values to the old values.<\/p>\n<p>There\u2019s also a breadcrumb bar at the top of the bubble to show me where this bubble sits in my code\u2019s structure. This method is in this class, which is in this namespace. I can click on the triangle to see this method\u2019s siblings and quickly bring them onto the canvas.<\/p>\n<p>Of course, we still haven\u2019t found the bug. So, let me step through the code a bit more. Now that I see all the relevant code, I notice that there\u2019s no place where any additions are happening. This parameter is supposed to represent the new amount we want in the cart, but we\u2019re just passing the old amount. Because the bubbles are full-blown editors, I can make the fix right here.<\/p>\n<p>I should probably also double check that I\u2019m not messing up other callers of this method. As usual I do al Find All References, but now when I click on them, they show up in the canvas. I see that the only other callers are these two tests, so I\u2019m not affecting other code. So my fix should be good.<\/p>\n<p>As a last step, let me jot down a quick note about what I did. Then, I can save my canvas as an XPS file, so I can share it with my team to show them how I fixed the bug.<\/p>\n<p>In the previous demo, you might be wondering how I chose where to set my breakpoint. Well, I actually started debugging by looking at an Intellitrace I generated by playing with the web app. Since bug is about posting a shopping cart request, I started with a search for post events. Then I switched over to the Call View to see what calls resulted.<\/p>\n<p>Debugger Canvas make using Intellitrace even nicer. Whenever I find an interesting part of a trace, I can drag and drop a method from the trace into the canvas. Debugger Canvas then populates the whole call tree for that method. I can then use the standard Intellitrace toolbar to step my way through the call tree.<\/p>\n<p>Well, that ends our quick tour. We hope you find Debugger Canvas useful, and we\u2019d love to hear your feedback.<\/p>\n<\/div>\n<p><!-- .asset-content --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick demo of Debugger Canvas, a new power tool for Visual Studio that rethinks the debugging experience. To see it in action, let\u2019s go after a bug in this web app for buying toys. As you can see I\u2019ve already got one model plane in my shopping cart. When I add the [&hellip;]<\/p>\n","protected":false},"featured_media":196164,"template":"","meta":{"msr-url-field":"","msr-podcast-episode":"","msrModifiedDate":"","msrModifiedDateEnabled":false,"ep_exclude_from_search":false,"_classifai_error":"","msr_hide_image_in_river":0,"footnotes":""},"research-area":[],"msr-video-type":[],"msr-locale":[268875],"msr-post-option":[],"msr-session-type":[],"msr-impact-theme":[],"msr-pillar":[],"msr-episode":[],"msr-research-theme":[],"class_list":["post-186294","msr-video","type-msr-video","status-publish","has-post-thumbnail","hentry","msr-locale-en_us"],"msr_download_urls":"","msr_external_url":"","msr_secondary_video_url":"","msr_video_file":"","_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video\/186294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/types\/msr-video"}],"version-history":[{"count":1,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video\/186294\/revisions"}],"predecessor-version":[{"id":415277,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video\/186294\/revisions\/415277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media\/196164"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media?parent=186294"}],"wp:term":[{"taxonomy":"msr-research-area","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/research-area?post=186294"},{"taxonomy":"msr-video-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video-type?post=186294"},{"taxonomy":"msr-locale","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-locale?post=186294"},{"taxonomy":"msr-post-option","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-post-option?post=186294"},{"taxonomy":"msr-session-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-session-type?post=186294"},{"taxonomy":"msr-impact-theme","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-impact-theme?post=186294"},{"taxonomy":"msr-pillar","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-pillar?post=186294"},{"taxonomy":"msr-episode","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-episode?post=186294"},{"taxonomy":"msr-research-theme","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-research-theme?post=186294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}