<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Bug Babble : Bugs</title><link>http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx</link><description>Tags: Bugs</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Simple VS Addin (updated)</title><link>http://blogs.msdn.com/stevejs/archive/2005/12/21/506477.aspx</link><pubDate>Wed, 21 Dec 2005 22:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:506477</guid><dc:creator>SteveJS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/506477.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=506477</wfw:commentRss><description>&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;Back during the PDC for Whidbey&amp;nbsp;I wrote a post about &lt;a href="http://blogs.msdn.com/stevejs/archive/2004/01/22/61901.aspx"&gt;Creating a Simple Addin&lt;/A&gt;.&amp;nbsp; Recently I was looking to update it and found a horrible bug in it.&amp;nbsp; First, here is the corrected code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; OnConnection(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; application, &lt;SPAN style="COLOR: teal"&gt;ext_ConnectMode&lt;/SPAN&gt; connectMode, &lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; addInInst, &lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Array&lt;/SPAN&gt; custom)&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_applicationObject = (&lt;SPAN style="COLOR: teal"&gt;DTE2&lt;/SPAN&gt;)application;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _addInInstance = (&lt;SPAN style="COLOR: teal"&gt;AddIn&lt;/SPAN&gt;)addInInst;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _debuggerEvents = _applicationObject.Events.DebuggerEvents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _debuggerEvents.OnEnterBreakMode += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;_dispDebuggerEvents_OnEnterBreakModeEventHandler&lt;/SPAN&gt;(DebuggerEvents_OnEnterBreakMode);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;DebuggerEvents&lt;/SPAN&gt; _debuggerEvents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; System.Collections.Generic.&lt;SPAN style="COLOR: teal"&gt;Queue&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;EditPoint&lt;/SPAN&gt;&amp;gt; epQ = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Collections.Generic.&lt;SPAN style="COLOR: teal"&gt;Queue&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;EditPoint&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; DebuggerEvents_OnEnterBreakMode(&lt;SPAN style="COLOR: teal"&gt;dbgEventReason&lt;/SPAN&gt; Reason, &lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;dbgExecutionAction&lt;/SPAN&gt; ExecutionAction)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;TextDocument&lt;/SPAN&gt; td = (&lt;SPAN style="COLOR: teal"&gt;TextDocument&lt;/SPAN&gt;) _applicationObject.ActiveDocument.Object(&lt;SPAN style="COLOR: maroon"&gt;"TextDocument"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;EditPoint&lt;/SPAN&gt; ep = td.Selection.ActivePoint.CreateEditPoint();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;ep.SetBookmark();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;epQ.Enqueue(ep);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;if&lt;/SPAN&gt; (epQ.Count &amp;gt; 5)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; epQ.Dequeue().ClearBookmark();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;BR&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;I've changed a couple of things.&amp;nbsp;&amp;nbsp;I now create the Editpoint first and use it to set the bookmark rather than setting the bookmark on the selection then creating an editpoint.&amp;nbsp; This removes that&amp;nbsp;possibility&amp;nbsp;that I&amp;nbsp;save a&amp;nbsp;different place then where&amp;nbsp;I set the bookmark.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;The&amp;nbsp;more important issue is I keep a member variable for _applicationObject.Events.DebuggerEvents.&amp;nbsp; Why?&amp;nbsp; Because it keeps&amp;nbsp;that&amp;nbsp;event provider&amp;nbsp;from getting garbage collected.&amp;nbsp; I had made the assumption that the lifetime of _applicationObject.Events.DebuggerEvents would be strictly tied to the DTE object, and managed by automation.&amp;nbsp; That is not the case.&amp;nbsp; The way this bug manifests is pretty ugly since the Addin works as expected for a while,&amp;nbsp;until the Event Provider (_applicationObject.Events.DebuggerEvents) is collected and Finalized, at which point the events just stop coming.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;I wasn't sure if this was by design or not.&amp;nbsp; However,&amp;nbsp;I found this KB article: &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;en-us;555430"&gt;Visual Studio .Net events being disconnected from add-in&lt;/A&gt;,&amp;nbsp;so I am going with it being&amp;nbsp;by design.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=506477" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Babble/default.aspx">Babble</category></item><item><title>Naming threads in Win32 And .Net</title><link>http://blogs.msdn.com/stevejs/archive/2005/12/19/505815.aspx</link><pubDate>Tue, 20 Dec 2005 08:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:505815</guid><dc:creator>SteveJS</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/505815.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=505815</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;When you are debugging an application with multiple threads it can be handy to have a better name than just the thread id.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is simple to do in managed code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is a property on the Thread object that you can set.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is also possible to do this for native code. However, there is simply no way you will ever discover it unless someone points you to&amp;nbsp;the difficult to find docs.&amp;nbsp; I knew about&amp;nbsp;the feature&amp;nbsp;and still missed&amp;nbsp;the docs&amp;nbsp;the first time I looked for them!&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;For completness, here is the managed version: &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;A href="http://msdn.microsoft.com/library/en-us/vsdebug/html/vxconSettingThreadNameManaged.asp?frame=true"&gt;Setting a Thread Name (Managed)&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The more interesting one is the native version: &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtsksettingthreadname.asp"&gt;Setting a Thread Name (Unmanaged)&lt;/A&gt;&amp;nbsp;(There is a typo in the documentation's code; 'except' should be '__except'. I've included a corrected copy below.)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;The native&amp;nbsp;method of setting the thread name&amp;nbsp;is&amp;nbsp;implemented by raising an SEH exception that is continued.&amp;nbsp; If you go to the docs on RaiseException you'll see&amp;nbsp;part of the reason for this strange mechanism.&amp;nbsp; An attached native debugger will get a 'first chance' notification of the exception.&amp;nbsp; Raising an exception is precisely what you need to do to get the native debugger's attention.&amp;nbsp;The one raised here (0x406D1388) is recognized by VS (and WinDbg).&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Note: If anything in your process installs a vectored exception handler, that handler will not&amp;nbsp;be called on this exception code&amp;nbsp;when the&amp;nbsp;VS debugger is attached.&amp;nbsp; The VS debugger always&amp;nbsp;handles this exception code and continues execution,&amp;nbsp;preventing any further handlers.&amp;nbsp;&amp;nbsp;In WinDbg you can go to Debug/Event Filters and set the "Visual C++&amp;nbsp;exception" to be disabled.&amp;nbsp;&amp;nbsp;With that setting,&amp;nbsp;your vectored exception handler will get a shot at 0x406D1388 while WinDbg is debugging it.&lt;/P&gt;&lt;PRE class=code&gt;//
// Usage: SetThreadName (-1, "MainThread");
//
typedef struct tagTHREADNAME_INFO
{
   DWORD dwType; // must be 0x1000
   LPCSTR szName; // pointer to name (in user addr space)
   DWORD dwThreadID; // thread ID (-1=caller thread)
   DWORD dwFlags; // reserved for future use, must be zero
} THREADNAME_INFO;

void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName)
{
   THREADNAME_INFO info;
   info.dwType = 0x1000;
   info.szName = szThreadName;
   info.dwThreadID = dwThreadID;
   info.dwFlags = 0;

   __try
   {
      RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&amp;amp;info );
   }
   __except(EXCEPTION_CONTINUE_EXECUTION)
   {
   }
}&lt;/PRE&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=505815" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Babble/default.aspx">Babble</category></item><item><title>FuncEvil, the Clipboard, and Deadlocks</title><link>http://blogs.msdn.com/stevejs/archive/2005/12/08/501939.aspx</link><pubDate>Fri, 09 Dec 2005 10:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:501939</guid><dc:creator>SteveJS</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/501939.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=501939</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;Mike Stall has a great post that, for a debugger dev, is the moral equivalent of sticking a fork in a toaster.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The basic problem he addresses is that once you are stopped in the debugger the UI for your application will no longer paint.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What if you need to see something on that UI? &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;If you like to live on the edge, Mike’s &lt;a href="http://blogs.msdn.com/jmstall/archive/2005/12/07/funceval_message_pump.aspx"&gt;Evil trick to render UI when stopped at a breakpoint&lt;/A&gt; is the answer for you.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Unfortunately, you need to be stopped on the UI thread for it to work.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Pumping messages on another thread will not unblock the UI to paint.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Even more unfortunate is that switching threads in the debugger won’t help.&amp;nbsp;&amp;nbsp;Function evaluation when debugging managed code requires you to be at a reasonable point on the thread. It is very unlikely you will randomly be at such a point, unless you stopped on the thread in question.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can see the result I got when I stop on another thread, then switched to the UI thread:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;?System.Windows.Forms.MessageBox.Show("pump")&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.”&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Now don’t let this dissuade you from how useful this very, very, very dangerous trick can be.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Sometimes playing with fire is useful.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Not rendering the UI is only one problem that can happen due to the debugger stopping a process. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;A really bad problem that lack of message pumping can cause is clipboard deadlock. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;The real problem is&amp;nbsp;&lt;/SPAN&gt;due to delayed rendering, which requires the app that copied to the clipboard to be live.&amp;nbsp; You can read about delayed rendering&amp;nbsp;on the MSDN &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/dataexchange/clipboard/clipboardoperations.asp"&gt;Clipboard Operations&lt;/A&gt; page.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The basic problem is that the application you are debugging owns the clipboard, and other apps need it to respond to messages to get the contents of the clipboard. You can see this by creating a trivial winform app with a button and a RichTextbox:&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/71710810/"&gt;&lt;IMG height=301 alt=TrivialWinForm src="http://static.flickr.com/35/71710810_c1a4882f5b_o.png" width=304&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(Note you need to use a RichTextBox here … a normal TextBox will actually copy the contents to the clipboard rather than using delayed rendering.)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;First set a breakpoint in the button handler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Then select the “Copy me at your own Risk!” text and copy it to the clipboard with Ctrl-C.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now hit the button.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Nothing is wrong yet.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However if you go to any application and hit paste that application is now hung, and will remain so until you continue from the breakpoint.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you hit paste in the debugger you’ll deadlock that too without any way to continue from the bp.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Clipboard deadlock&amp;nbsp;has hit me few a times composing mail while stopped at a breakpoint.&amp;nbsp;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;Using the trick that Mike outlines does free&amp;nbsp;the applications&amp;nbsp;waiting for your winform app to provide the clipboard data. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;If you do not understand why func eval is evil I must end by pointing you to Mike's older post &lt;a href="http://blogs.msdn.com/jmstall/archive/2005/03/23/400794.aspx"&gt;Func-eval is evil&lt;/A&gt;, and GreggM's more recent&amp;nbsp;post &lt;A id=_ctl0__ctl0__ctl0__ctl0_RecentPosts__ctl0_postlist__ctl0_EntryItems__ctl0_PostTitle href="/greggm/archive/2005/11/18/494648.aspx"&gt;&lt;FONT color=#006bad&gt;Func eval and System.Windows.Forms.Form&lt;/FONT&gt;&lt;/A&gt;.&amp;nbsp; Func Eval is powerful, and with great power comes a bunch of power to shoot yourself in the foot.&amp;nbsp; Be careful using func eval.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=501939" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Babble/default.aspx">Babble</category></item><item><title>Change Debugger behavior with Attributes</title><link>http://blogs.msdn.com/stevejs/archive/2005/12/03/499803.aspx</link><pubDate>Sun, 04 Dec 2005 00:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:499803</guid><dc:creator>SteveJS</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/499803.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=499803</wfw:commentRss><description>&lt;DIV class=Section1&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Certain metadata attributes modify the stepping, breakpoint, and callstack behavior of the VS managed Debugger.&amp;nbsp; This is useful if you are creating an interpreter, language runtime, or a tool that modifies the code in a managed assembly.&amp;nbsp; There are three flavors of these attributes that affect execution control.&amp;nbsp; Each behaves slightly differently, and I always forget which does what, so I'm recording it here for my own reference as well.&amp;nbsp;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&amp;nbsp;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The code below shows examples using all three attributes: DebuggerStepThrough, DebuggerHidden, and DebuggerNonUserCode.&amp;nbsp; The example also shows the hidden line directive.&amp;nbsp;&amp;nbsp;I've inlined the explanation as comments in the code so it can travel with the example.&amp;nbsp;&amp;nbsp;This general area of writing tools that interact with the debugger has been well explored on Mike Stall's blog:&lt;/SPAN&gt;&lt;BR&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&amp;nbsp;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;a href="http://blogs.msdn.com/jmstall/archive/2005/06/19/FeeFee_SequencePoints.aspx"&gt;#line hidden and 0xFeeFee sequence points&lt;/A&gt;&lt;/SPAN&gt;&lt;BR&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;a href="http://blogs.msdn.com/jmstall/archive/2004/12/31/344832.aspx"&gt;How can I debug Just My Code?&lt;/A&gt;&lt;/SPAN&gt;&lt;BR&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;a href="http://blogs.msdn.com/jmstall/archive/2005/07/27/state_machine_theory.aspx"&gt;Debug support for arbitrary state-machines&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; System;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// This example shows the use of the three debugger attributes&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// that modify the runtime behavior of the VS debugger.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The motivating example is part of an AOP (Aspect Oriented Programming)&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// implemenatation.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The concepts around AOP are pretty interesting, but for this&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// example it is sufficient to know that anything called a 'Thunk'&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// is something added by the tool that is of no interest to the user.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The example code is what a weaver that uses C# as a backend could &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// send to the compiler to accomplish the hiding of &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// JoinPointThunks, and the calls to those thunks.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Try stepping through this with this option on:&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Tools/Options/Debugging/General/Enable Just My Code&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Then try the same with the option off.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// You'll see that each attribute creates a slightly different end user&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// behavior and slightly different ease of debugging for yourself&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// when you need to debug the glue code you are hiding from the user.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; bar()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"Hello advice\n"&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;};&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;DebuggerStepThrough&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ExampleJoinPointThunk_withDebuggerStepThrough()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code ON:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: Frame is viewable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: Will hit bp.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING:&amp;nbsp; Will not stop inside due to a step.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// (Even from bp hit! Any step is a step out.)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Step in will land inside called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code OFF:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: [External Code] frame.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; Real frame is viewable by selecting 'Show External Code'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; in Callstack window.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: No bp will set or hit. A warning is provided, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING: Will not stop inside method (step in or step out)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp; A step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;.bar();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; thisGoesTo = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;DebuggerHidden&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ExampleJoinPointThunk_withDebuggerHidden()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code ON:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: Frame is completely hidden.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: A Bp will set with no error, but will not hit!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//stepping: A Step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code OFF:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: Frame is completely hidden. (i.e. No [External Code])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP:Warning provided, no bp will set or hit.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING: Will not stop inside method (step in or step out)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp; A step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;.bar();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; thisGoesTo = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;DebuggerNonUserCode&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ExampleJointPointThunk_withDebuggerNonUserCode()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// [Same as normal code.]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code ON: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;Normal&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt; view, callstack is viewable.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: A bp will set and hit.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING: Step as normal.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// [Same as Debugger StepThrough]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code OFF&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view:[ External Code] frame.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; Real frame is viewable by selecting 'Show External Code'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; in Callstack window.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: Warning provided, no bp will set or hit.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING:&amp;nbsp; Will not stop inside method (step in or step out)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp; A step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;.bar();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; thisGoesTo = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;};&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: teal"&gt;Program&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; foo()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; hidden&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//this emits a Sequence Point with line = 0xFeeFEE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//Imagine these hidden areas were added dynamically&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;.ExampleJoinPointThunk_withDebuggerStepThrough();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; default&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; theone = 1;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; hidden&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;.ExampleJoinPointThunk_withDebuggerHidden();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; default&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; volume = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; hidden&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;.ExampleJointPointThunk_withDebuggerNonUserCode();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; default&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; answer = 42;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;[] args)&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The #line hidden directive places 0xFeeFee sequence point in the line &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// information. The 0xFeeFee sequence point tells the debugger to continue&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// stepping.&amp;nbsp; It is not necessary unless a step can end at the location.&amp;nbsp; &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// If you are writing a compiler and emitting your own debug information,&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// then it is often possible to simply omit the line info for code that would&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// be marked hidden. If you decompile the above code with ILDasm /Linenum you&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// will see an example of that strategy.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// However there are cases where it is important to use the a hidden sequence&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// point. Any place where a branch instruction lands must use a hidden sequence&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// point if you do not want the debugger to stop there.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The motivating example for this is having all exit points from a Try block&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// branch to a single leave instruction.&amp;nbsp; If you produce that type of codegen&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// you will need to use 0xFeeFee to create reasonable stepping behavior.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=Section1 style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=499803" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Babble/default.aspx">Babble</category></item><item><title>Netmodules: Sort of like a lib</title><link>http://blogs.msdn.com/stevejs/archive/2005/11/27/497333.aspx</link><pubDate>Mon, 28 Nov 2005 06:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:497333</guid><dc:creator>SteveJS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/497333.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=497333</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I first ran into netmodules before VS 2002 was shipped. The netmodule gave me precisely what I asked for, without actually solving my problem.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I wanted to use multiple languages (C#, and C++ /clr)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;in a single assembly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It turns out a single assembly can be multi-module.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Multi-module means a single .Net assembly is spread across multiple win32 dlls. &amp;nbsp;&lt;/SPAN&gt;What I really wanted was a single module&amp;nbsp;assembly written in multiple languages. Netmodules couldn't solve my problem back then, but with the VS 2005&amp;nbsp;C++ linker&amp;nbsp;they can now.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Check out JuFeng's articles for some more in depth coverage, and an explanation why you might want a multi-module assembly:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/junfeng/archive/2004/07/15/183813.aspx"&gt;MultiModule Assemblies&lt;/A&gt; &lt;/P&gt;
&lt;P style="MARGIN: 0in; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;a href="http://blogs.msdn.com/junfeng/archive/2005/02/12/371683.aspx"&gt;Netmodule vs. Assembly&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Since JuFeng's examples didn't show how to create debug info I thought I'd make an updated example here.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Here's a quick example with a multi-module assembly:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750045/"&gt;&lt;IMG height=195 alt=a_source src="http://static.flickr.com/26/67750045_149369f8c9_o.png" width=273&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750046/"&gt;&lt;IMG height=105 alt=b_source src="http://static.flickr.com/34/67750046_ce07feeb38_o.png" width=238&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;From the Visual Studio&amp;nbsp; 2005 Command Prompt:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;vbc /target:module /debug+ b.vb&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;csc /debug+ /addmodule:b.netmodule a.cs&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;devenv /debugexe a.exe&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Check out the modules window:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750048/"&gt;&lt;IMG height=74 alt=multi_module src="http://static.flickr.com/26/67750048_6436579988_o.png" width=709&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;And the callstack window:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67755934/"&gt;&lt;IMG height=88 alt=multi2_callstack src="http://static.flickr.com/29/67755934_08261ecb38_o.png" width=294&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;To get a single file assembly I'll need to recompile the cs file into a netmodule then use the c++ linker.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;csc /addmodule:b.netmodule /target:module /debug+ a.cs&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;link /entry:fooCS.Main /out:theone.exe /subsystem:console /debug a.netmodule b.netmodule&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;devenv /debugexe theone.exe&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Now check out the modules window:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750050/"&gt;&lt;IMG height=54 alt=single_module src="http://static.flickr.com/34/67750050_5b72c149be_o.png" width=730&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;And the callstack window:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67755935/"&gt;&lt;IMG height=79 alt=single2_callstack src="http://static.flickr.com/32/67755935_9777ee3976_o.png" width=321&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=497333" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Babble/default.aspx">Babble</category></item><item><title>XSLT debugging in Visual Studio</title><link>http://blogs.msdn.com/stevejs/archive/2005/11/16/493805.aspx</link><pubDate>Thu, 17 Nov 2005 10:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:493805</guid><dc:creator>SteveJS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/493805.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=493805</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Visual Studio is a big tool.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It's easy to miss some useful features.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Hopefully t&lt;/SPAN&gt;he XSLT debugger won't get missed.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If you want to learn how to use XSLT debugging take a look at Neetu Rajpal's msdn article &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/xmltools.asp"&gt;Introducing Xml tools in VS 2005&lt;/A&gt;.&amp;nbsp; Below you can see the debugger in action as an xslt transform is being applied to some XML. &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;(Please excuse the nonsense XSLT I use in the example.&amp;nbsp; I haven't had a chance to play around with XSLT for quite some time.)&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64132295/"&gt;&lt;IMG height=179 alt=XSLTdebugging src="http://static.flickr.com/33/64132295_840be0980d_o.png" width=652&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;XSLT debugging is interesting to me because much of it is the managed debugger.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;XSLT is compiled to msil, and the managed debugger is used to provide things like breakpoints and stepping.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;You can see this by opening the modules window.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You'll see in the last column that the process is a managed process called the Microsoft.XSLDebugProxy.exe, and there will be some modules loaded with names like System.Xml.Xsl.CompiledQuery.1.&amp;nbsp;&amp;nbsp;&amp;nbsp;All of the debugger windows work as expected: callstack, locals, immediate, threads, modules.&amp;nbsp; You can see below the callstack for my nonsense example:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64135280/"&gt;&lt;IMG height=100 alt=XSLTcallstackwithJMC src="http://static.flickr.com/30/64135280_a911535011_o.png" width=476&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;However! Go to the callstack window and right click to get the context menu.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There will be an item called Show External Code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Pick that and you get to see much in the callstack window that was hidden before.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The grey colored frames are&amp;nbsp;because there is no debug info (pdb file) for that assembly, which is why those frames were marked as 'External Code' before.&amp;nbsp; The CompiledQuery frames were hidden because the XSLT compiler placed an attribute on them to tell the debugger they were not of interest.&amp;nbsp;&amp;nbsp; With the expanded view&amp;nbsp;you can now&amp;nbsp;see the compiled query and the code that dispatched it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64135279/"&gt;&lt;IMG height=457 alt=XSLTCallstackWithoutJMC src="http://static.flickr.com/29/64135279_3386e1de8d_o.png" width=467&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;However, while that is interesting it is unlikely to help you get at a bug in your XSLT.&amp;nbsp; The Locals window however appears to be one of the more useful windows, that can help you see what is happening as the transforms are applied.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64137060/"&gt;&lt;IMG height=126 alt=LocalsWindowXSLTdebugging src="http://static.flickr.com/35/64137060_f5844b842a_o.png" width=520&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=493805" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Perf Awareness is not Premature </title><link>http://blogs.msdn.com/stevejs/archive/2005/11/06/489644.aspx</link><pubDate>Mon, 07 Nov 2005 02:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:489644</guid><dc:creator>SteveJS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/489644.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=489644</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I've&amp;nbsp;found myself adding a timer to each of the unit test frameworks I use so I can see how long my tests take.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I am not trying to do anything complex.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I just want to be aware of&amp;nbsp;the perf.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The same way pass and fail are visible, 1ms vs 90ms is visible. &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Premature optimization rightly has a bad rep.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Creating&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;complex code where performance doesn't matter is a bad tradeoff.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;That's not what I'm doing here.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I&amp;nbsp;am not trying to code for perf.&amp;nbsp; I'm trying to be perf aware.&amp;nbsp; If&amp;nbsp;the test&amp;nbsp;is fast I'm certainly not going to use that as an excuse to&amp;nbsp;start changing code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If it's slow, I know about it and I won't check in something that kills perf.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Once you have a number, t&lt;/SPAN&gt;he real question is: How do you judge if it is&amp;nbsp;fast or slow?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; The answer is a perf budget.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Rico Mariani has a great &lt;a href="http://blogs.msdn.com/ricom/archive/2003/12/12/43245.aspx"&gt;Designing for Performance&lt;/A&gt;&amp;nbsp;post where he talks about&amp;nbsp;using Perf budgets.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;In the absence of a perf budget, spend your time getting a perf budget rather than mucking about with code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Once you have perf budgets, being aware of resource consumption makes it easier to see problems earlier.&amp;nbsp; A perf problem is a bug.&amp;nbsp; Fixing a&amp;nbsp;bug before it gets into the source tree is always a good idea.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=489644" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Babble/default.aspx">Babble</category></item><item><title>Checking the result of new is a bug in C++</title><link>http://blogs.msdn.com/stevejs/archive/2005/11/01/487776.aspx</link><pubDate>Tue, 01 Nov 2005 21:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:487776</guid><dc:creator>SteveJS</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/487776.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=487776</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;At least, it is a bug in VC8.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; That check won't happen. &amp;nbsp;&lt;/SPAN&gt;Reading Larry Osterman's recent posts&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;&lt;a href="http://blogs.msdn.com/larryosterman/archive/2005/10/28/486409.aspx"&gt;"What's wrong with this code, part 15"&lt;/A&gt; and the &lt;a href="http://blogs.msdn.com/larryosterman/archive/2005/10/31/487352.aspx"&gt;answers&lt;/A&gt;, reminded me this behavior changed in VC8.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you check the result of new in code compiled with VC8, your code is wrong.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;The call to new will throw.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Yes,&amp;nbsp;your code&amp;nbsp;worked in 5.0,&amp;nbsp;6.0,&amp;nbsp;(maybe) 7.0 and&amp;nbsp;7.1, but&amp;nbsp;it doesn't now.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;You can get the old behavior if you&amp;nbsp;link with nothrownew.obj.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The linker will then make every call to new in your dll (or exe) non-throwing.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;This is incompatible with STL, or any other code that relies on new throwing.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;The only other option is to use&amp;nbsp;std::nothrow placement new.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Don't do that.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;If you are writing code that uses no throw semantics, you probably&amp;nbsp;need those same semantics from the libs you link as well.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If you are linking a lib that was coded expecting new to return NULL rather than throw, the linker doesn't know that.&amp;nbsp;&amp;nbsp;In VC8 it&amp;nbsp;will&amp;nbsp;link the throwing version.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;Linking with&lt;/SPAN&gt; nothrownew.obj tells the linker that everything needs the old, non-standard version of new that returns NULL.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;What if you are using 2 libs?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One that needs the non-standard new, and one that needs the standard new?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If that is the case, package one in it's own dll,&amp;nbsp;or&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;change it so you have consistency on the definition of new.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Don't bother trying to get the linker to do something magical.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It won't.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The linker makes a decision on what new means and that's it for the entire dll.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;History of new through the VC's:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;In VC5.0, and VC6.0 you basically got nothrow new and had to jump through hoops to get a throwing version.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;MFC did use a throwing version, but it doesn't throw std::bad_alloc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Also new(std::nothrow), had bugs which caused&amp;nbsp;it to throw in some circumstances.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For users of non throwing new, life was good.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For everyone else, not so much. See this msdn article &lt;A href="http://msdn.microsoft.com/msdnmag/issues/03/09/LegacySTLFix/default.aspx"&gt;"Don't Let Memory Allocation Failures crash your lagacy STL Application"&lt;/A&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;for the details.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;In 7.0 and 7.1 the VC++ team attempted to do something clever.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The version of new you get is controlled by the first significant header in the first obj linked.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This means a large number of examples do exactly what you'd expect.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It also means there are corner cases where it is almost impossible to understand what's happening.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Y&lt;/SPAN&gt;ou could force&amp;nbsp;a standard complying&amp;nbsp;new by linking thrownew.obj.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;In 8.0 the VC++ team decided to clean up many standard compliance issues.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Now the C++ standard is used.&amp;nbsp; Full Stop.&amp;nbsp;&lt;SPAN style="mso-spacerun: yes"&gt; I&lt;/SPAN&gt;f you want the old behavior,&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;you must link nothrownew.obj.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Finally, I must thank Martyn Lovell for explaining the&amp;nbsp;background on this issue, and clarifying some of the details.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If there are any errors&amp;nbsp;here&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;they are&amp;nbsp;due to me&amp;nbsp;alone.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=487776" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>PsuedoVariables and Format Specifiers</title><link>http://blogs.msdn.com/stevejs/archive/2005/10/18/482300.aspx</link><pubDate>Tue, 18 Oct 2005 19:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:482300</guid><dc:creator>SteveJS</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/482300.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=482300</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;The VS debugger has a history of tiny but useful features hidden in the expression evaluator.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;These features are like the yellow shirted ensign in star trek.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;They are useful, but unknown and expendable.&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;Developer's learn about them by attending a Power Debugging talk, or buying one of &lt;A href="http://www.amazon.com/exec/obidos/tg/detail/-/0735615365/qid=1129653434/sr=1-3/ref=sr_1_3/102-2363746-4474537?v=glance&amp;amp;s=books"&gt;John Robbins&lt;/A&gt; very good books.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I started blogging about some of these features recently.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;When I mentioned that to &lt;a href="http://blogs.msdn.com/ms_joc"&gt;John Cunningham&lt;/A&gt;, he told me he had already blogged about these.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I did a search and found something even more surprising.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There's real documentation!&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Pseudovariables: (This is what I was going to blog about. Goodbye series of good blog topics.)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms164891(en-US,VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms164891(en-US,VS.80).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;You should also see these blog posts for pseudovariables in action:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/greggm/archive/2004/12/11/279978.aspx"&gt;Whidbey Debugger pseudo-register - $user&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/stevejs/archive/2005/10/13/480669.aspx"&gt;Devenv stealth feature, Poor Man's Profiler&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/matt_pietrek/archive/2004/08/04/208392.aspx"&gt;Cool Whidbey debugger feature: Merge Environment&lt;/A&gt; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/ms_joc/archive/2004/08/23/218912.aspx"&gt;One last debugger tip&lt;/A&gt;&lt;/P&gt;&lt;a href="http://blogs.msdn.com/matt_pietrek/archive/2004/08/04/208392.aspx"&gt;&lt;/A&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Format specifiers in C++: &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/75w45ekt(en-US,VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/75w45ekt(en-US,VS.80).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Format specifiers in C#:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms164891"&gt;http://msdn2.microsoft.com/en-us/library/ms164891&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Format specifiers are useful for telling the debugger how you want to display the value of an expression.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the watch window the 'Size Specifier for pointers and Arrays' is very useful.&amp;nbsp; When you start using Tracepoints you'll quickly find ,x and ,d are invaluable.&amp;nbsp; There are more extensive mechanisms for customizing&amp;nbsp;how expressions&amp;nbsp;are displayed in&amp;nbsp;VS, but that is a topic for another day.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=482300" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>$env=0</title><link>http://blogs.msdn.com/stevejs/archive/2005/10/15/481472.aspx</link><pubDate>Sun, 16 Oct 2005 01:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:481472</guid><dc:creator>SteveJS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/481472.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=481472</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Winning the award for the least understandable UI metaphor: the ability to view the environment variables in the target&amp;nbsp;when native debugging.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is yet another tiny undocumented feature of the native expression evaluator in VS.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;$env&lt;/SPAN&gt; falls under the same extravagant disclaimer from the &lt;a href="http://blogs.msdn.com/stevejs/archive/2005/10/13.aspx"&gt;@clk post&lt;/A&gt;.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Place $env in the watch window and you get … the size in bytes of your environment block.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Wow.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Far more useful is to type "$env=0", which evaluates to "0", and dumps all the Environment Variables to the output window.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you use the Immediate window "?$env=0" you get everything inline.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The feature requires you to be native (or interop) debugging and to evaluate it from a native frame.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Despite the insane UI interaction, the end result is very useful information.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=481472" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Assembly language survival guide (for Debugging ... not writing)</title><link>http://blogs.msdn.com/stevejs/archive/2005/10/14/481121.aspx</link><pubDate>Fri, 14 Oct 2005 19:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:481121</guid><dc:creator>SteveJS</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/481121.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=481121</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: black; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;Knowing just enough assembly is a really powerful aid in Debugging.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These are short articles that hit the sweet spot of enough information to be very useful, but not so much that it is a chore to learn:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 0in; FONT-FAMILY: 'times new roman'; mso-outline-level: 1"&gt;&lt;FONT face=Arial size=3&gt;Matt's Just Enough Assembly Language to Get By:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 16pt; MARGIN: 0in; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;&lt;A href="http://www.microsoft.com/msj/0298/hood0298.aspx"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT size=2&gt;http://www.microsoft.com/msj/0298/hood0298.aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="COLOR: black"&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 16pt; MARGIN: 0in; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;&lt;A href="http://www.microsoft.com/msj/0698/hood0698.aspx"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#0000ff size=2&gt;http://www.microsoft.com/msj/0698/hood0698.aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="COLOR: black"&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;GreggM also has&amp;nbsp;&lt;SPAN style="COLOR: black"&gt;some&lt;/SPAN&gt; blog posts that show very&amp;nbsp;useful features and techniques&amp;nbsp;in this area:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;&lt;SPAN style="COLOR: black"&gt;What&lt;/SPAN&gt; you can and cannot trust&lt;SPAN style="COLOR: navy"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;from the debugger&lt;/SPAN&gt;:&lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: 'times new roman'; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/greggm/archive/2004/12/15/315673.aspx"&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;http://blogs.msdn.com/greggm/archive/2004/12/15/315673.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;&lt;SPAN style="COLOR: black"&gt;A powerful&lt;/SPAN&gt; technique for finding COM pointers on the stack:&lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: 'times new roman'; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/greggm/archive/2005/08/01/446293.aspx"&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;http://blogs.msdn.com/greggm/archive/2005/08/01/446293.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial; mso-outline-level: 1"&gt;Getting back to the exception from an unhandled exception filter (.cxr):&lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: 'times new roman'; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/greggm/archive/2004/08/25/220360.aspx"&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;http://blogs.msdn.com/greggm/archive/2004/08/25/220360.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=481121" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Devenv stealth feature, Poor Man's Profiler</title><link>http://blogs.msdn.com/stevejs/archive/2005/10/13/480669.aspx</link><pubDate>Thu, 13 Oct 2005 19:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:480669</guid><dc:creator>SteveJS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/480669.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=480669</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: black; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;This feature is unsupported. It is undocumented. If you call help desk about it nice people will say “huh?”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If it breaks, people will nod knowingly and say “I told you so”. In later versions it may simply disappear.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It could decay right now as I speak and explode! (maybe not.)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;One more disclaimer ... it is Native Only, it does not work for managed debugging.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: black; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;The @clk 'pseudo register'&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;has been around for a while.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you have VS7.0 or greater you can use this.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is the poor mans profiler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Stick @clk in the watch window and you get a tick count.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Each time you step it will be updated.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Put @clk=0 in the next slot of the watch window and the first @clk will show the time (including debugger overhead) since the last stop.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: black; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;But wait there's more!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;With the advent of tracepoints you can get @clk on steroids.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Set a bp, then right click on the red bp circle and go to "When hit".&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the dialog check the "Print message" check box and fill in this: {@clk},{@clk=0} $FUNCTION.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now open the output window and run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You will get a list of tickcount deltas between each tracepoint hit.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: black; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Here is an example I&amp;nbsp;took&amp;nbsp;for&amp;nbsp;devenv rendering a callstack with 8 frames:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;406298197,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;111466,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;6228,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4657,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5933,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;8049,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5844,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;92580,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long,g unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;You'll notice the first tick count is meaningless, the rest give relative times.&amp;nbsp;&amp;nbsp;Here we&amp;nbsp;can see the time between the&amp;nbsp;1st and&amp;nbsp;2nd&amp;nbsp;and&amp;nbsp;the time between the 7th and 8th&amp;nbsp;calls took substantially more time.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Looking at the callstack&amp;nbsp;frames generated by those two calls&amp;nbsp;each required function evaluation.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;I went to the callstack window and turned off 'Show parameter values'.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The refresh of the callstack without function evaluation gave me some new data:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;732630352,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;3452,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5125,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5117,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;2648,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5406,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4818,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5432,0 CDebugStackFrame::GetArgs(unsigned short * *, unsigned long, unsigned int)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Note the $FUNCTION is optional.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here is what I get when I remove that bit:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;With Function evaluation:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;1122488927,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;82541,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4880,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5737,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;2480,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;6899,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4696,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;83810,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Without function evaluation:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;8114431,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5796,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4868,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4858,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;2352,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5077,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;4676,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;5413,0&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;So, how long is a 'tickcount'? You need to ask the hardware (&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers/timerreference/timerfunctions/queryperformancefrequency.asp"&gt;QueryPerformanceFrequency&lt;/A&gt;)&amp;nbsp;as the &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers/timerreference/timerfunctions/queryperformancecounter.asp"&gt;QueryPerformanceCounter api&lt;/A&gt;&amp;nbsp;this uses is hardware dependent.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Also as a side note the numbers above are from a debug build of devenv running a checked version of the clr.&amp;nbsp; I've had testers mock me for how slow my machine appears with a checked clr, so don't bother reading too much into those values.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=480669" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Edit &amp; Continue trick for Conditional Bps</title><link>http://blogs.msdn.com/stevejs/archive/2005/10/11/479975.aspx</link><pubDate>Wed, 12 Oct 2005 09:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:479975</guid><dc:creator>SteveJS</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/479975.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=479975</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Using Edit and Continue to fix a bug&amp;nbsp;is handy, but don't wait until you've found the bug to start editing.&amp;nbsp;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One powerful technique is to use&amp;nbsp;E&amp;amp;C when you are still trying to find the problem.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Edit and Continue allows you to make any conditional bp into a normal bp.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is useful for two reasons.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;First, if you only have&amp;nbsp;an Express Edition this is&amp;nbsp;the only way you are going to get a conditional bp for managed code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; T&lt;/SPAN&gt;he C++ express edition does have conditional bps for native.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;If you have a full edition it is still useful because conditional bps are sometimes just too slow. The debugger implements conditional bps by setting a breakpoint that is always hit, then evaluating the condition on each hit.&amp;nbsp;If the location you want to stop&amp;nbsp;at is a cpu hot spot, it may be too slow. &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Here's an example using native C++ E&amp;amp;C to place a fast conditional bp:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;First, a normal conditional bp:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;int i = 0; // Instruction Pointer&amp;nbsp;starts here&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;while(true)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;{&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 1in; FONT-FAMILY: Verdana; mso-outline-level: 3"&gt;i++;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;// &lt;STRONG&gt;Conditional bp&amp;nbsp; "i==10000" here, takes ~ 134ms on my machine&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;}&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Now, using E&amp;amp;C (note 2 orders of magnitude are added to the condition so the time registers):&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;int i = 0; // Instruction Pointer starts&amp;nbsp;here&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;while(true)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;{&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 1in; FONT-FAMILY: Verdana; mso-outline-level: 3"&gt;// &lt;STRONG&gt;Two lines below are added via E&amp;amp;C&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 1in; FONT-FAMILY: Verdana; mso-outline-level: 3"&gt;if (i==1000000)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 1.5in; FONT-FAMILY: Verdana; mso-outline-level: 4"&gt;i=i; // &lt;STRONG&gt;bp here, takes 3 ms (including E&amp;amp;C apply)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 1in; FONT-FAMILY: Verdana; mso-outline-level: 3"&gt;i++;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2"&gt;}&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Remember to delete your inline conditional bps once you are done debugging!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=479975" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/stevejs/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Is there such a thing as a good bug? </title><link>http://blogs.msdn.com/stevejs/archive/2005/10/05/477402.aspx</link><pubDate>Wed, 05 Oct 2005 19:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:477402</guid><dc:creator>SteveJS</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/477402.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=477402</wfw:commentRss><description>&lt;P&gt;I was dreaming last night that Shai and I were cleaning an old apartment, when&amp;nbsp;a hockey puck sized bug crawled onto&amp;nbsp;Shai's hand.&amp;nbsp; In real life there would have been screaming. In the dream she lifted it up so we could both look at it.&lt;/P&gt;
&lt;P&gt;I am not an entomologist, but I'd be surprised if this was a real bug.&amp;nbsp;It looked like a giant beetle with a coat of lady bug paint.&amp;nbsp; Shai said there was nothing to worry about, "We want this kind of bug. It eats mice." It certainly looked big enough to handle the job.&amp;nbsp; An insect that doesn't bother you and eats other vermin isn't the worst thing in the world.&amp;nbsp; &lt;A href="http://www.biconet.com/reference/HGbeneficials.html"&gt;Attracting good insects&lt;/A&gt; is a strategy for pest control in organic farming.&amp;nbsp; An insect is only a pest if it hurts your crop.&lt;/P&gt;
&lt;P&gt;Is there such a vermin eating bug in software development? Maybe.&amp;nbsp; First, lets decide to agree, for the rest of this blog entry, that 'bug' means flaw in your software, rather than a visible symptom.&amp;nbsp; Is there a difference? You bet.&amp;nbsp; If you rely on undefined behavior, that happens to be true right now, by the bug = flaw definition you have a bug.&amp;nbsp; By the bug = symptom definition&amp;nbsp;you do not. (BTW- Don't kid yourself, if you rely on undefined behavior you do have a bug.)&lt;/P&gt;
&lt;P&gt;Right now, bug = flaw is any insect in reach, and bug = symptom is paying attention only to the bugs you see killing your plants. So far, these definitions are not helping&lt;BR&gt;to create a category of good bugs.&amp;nbsp; You obviously don't want to ship software with symptoms, and you don't want to ship software with unseen flaws waiting to crawl out from under the counter. Where might one's person's bug, be another person's useful insect? &lt;/P&gt;
&lt;P&gt;The answer is in testing, and I can give two examples, thanks to having read Michael Feathers' &lt;A href="http://www.amazon.com/exec/obidos/tg/detail/-/0131177052/002-3884125-3653624?v=glance"&gt;Working Effectively with Legacy Code&lt;/A&gt;.&amp;nbsp;&amp;nbsp;One example is a flaw in &lt;A href="http://www.gotw.ca/publications/xc++s.htm"&gt;style&lt;/A&gt;. Using protected data members in C++ is considered bad style because it &lt;A href="http://www.gotw.ca/gotw/070.htm"&gt;breaks encapsulation&lt;/A&gt;.&amp;nbsp; The root of the argument is the same as for why public data members are bad.&amp;nbsp; I think of it this way: How do you write an abstraction function, or an invariant for your class if you cede control over the data? Your class either needs to be a container that does not encapsulate or it should make it's data private.&amp;nbsp; Another example is an implementation flaw.&amp;nbsp; When you create a singleton you want to ensure there is only one such object.&amp;nbsp; If it is possible to create another instance then there is a flaw. &lt;/P&gt;
&lt;P&gt;So multiple singleton objects and protected data members are examples of my mouse eating, lady bug painted, giant beetle. These can be considered software insects not because your customer cares about protected vs private or multiple singletons. These are software insects because someone tending your code (maybe even you) could step on them and create a big gooey mess. &lt;/P&gt;
&lt;P&gt;How might these software insects be useful? It is useful to use each of these 'flaws' as a seam to test your code.&amp;nbsp; A seam is a place where you can highjack functionality without changing the callsite you want to test.&amp;nbsp; Substituting a derived class during testing is a very useful technique.&amp;nbsp; In legacy code it can be a good practice to move private data to protected simply to allow the derived testing class the control it needs to do it's job. You then need to use engineering discipline rather than the compiler to ensure that you maintain your invariants.&amp;nbsp; This is a techinique where you are trading compiler checked goodness for a possibly greater goodness ... deep targeted testing. &lt;/P&gt;
&lt;P&gt;Often a singleton is used when you are enforcing a direct mapping to something physical (such an external input device).&amp;nbsp; Imagine you are writing a software program to guess a person's birthdate by their weight on a scale.&amp;nbsp; Do you want to test it by automating the placement of actual weight on a scale? Or by making a fake version of your singleton scale class and instantiating it?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There are alternative designs that avoid the need for&amp;nbsp;a scary yet helpful software insect to provide testability.&amp;nbsp; However, if you live in a code base that was not designed for testing, think about how these software insects could be your friend, as you travel toward those better designs.&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=477402" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category></item><item><title>Random Repros</title><link>http://blogs.msdn.com/stevejs/archive/2005/10/03/476664.aspx</link><pubDate>Tue, 04 Oct 2005 04:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:476664</guid><dc:creator>SteveJS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevejs/comments/476664.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevejs/commentrss.aspx?PostID=476664</wfw:commentRss><description>&lt;P&gt;Adi Oltean continues a great series of blogs about supportability, with this one about &lt;a href="http://blogs.msdn.com/adioltean/archive/2005/10/03/476605.aspx"&gt;Random Repros&lt;/A&gt;.&amp;nbsp; Stop reading this.&amp;nbsp; Go read that.&amp;nbsp; And reply in his comments, if you have any ideas nearly as good as his.&lt;/P&gt;
&lt;P&gt;There are a couple of reason tough bugs are hard.&amp;nbsp; The most common reason is the repro is too elusive.&amp;nbsp; If&amp;nbsp; you've ever dismissed a bug as 'No repro', think about the fact that someone did repro the problem at one point.&amp;nbsp; Are you resolving&amp;nbsp;'No repro'&amp;nbsp;because you think it doesn't exist now?&amp;nbsp; Do you think the bug report&amp;nbsp;was a mistake?&amp;nbsp; Or&amp;nbsp;are you saying 'No repro'&amp;nbsp;because you cannot make progress without a repro?&amp;nbsp; Next time you resolve 'No repro' make sure you are clear why.&amp;nbsp; Then&amp;nbsp;ask yourself: If there really is a bug here what could help track down a consistent repro?&lt;/P&gt;
&lt;P&gt;I'm not claiming that chasing every red herring is a worthwhile exercise.&amp;nbsp; Testing, and development are human processes and sometimes errors occur.&amp;nbsp; Don't suspend good judgement.&amp;nbsp; However, as a developer,&amp;nbsp;it is better to be clear that you think a bug is a mistake then to whimp out with an unclarified 'No repro'.&amp;nbsp; As a tester, if you get a resolution of&amp;nbsp;'No repro' it is worthwhile to ask the developer if they think the bug was a mistake, already fixed, or simply elusive.&amp;nbsp;If the bug is simply hiding effectively, then it is everyone's job to help flush it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=476664" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevejs/archive/tags/Bugs/default.aspx">Bugs</category></item></channel></rss>