Welcome to MSDN Blogs Sign in | Join | Help

March 2005 - Posts

C# and Equals() in V2.0 versus V1.0.

Here’s some wacky trivia: In v1.1, C# evaluates 3 f .Equals(3) to False. In v2.0, it evaluates to True. (Note that the f suffix lexes as floating point, so 3f is floating-point and 3 is integer). Folks seem to like the v2.0 behavior a lot more, so this
Posted by jmstall | 7 Comments
Filed under:

Func-eval is evil

Function evaluation (aka “Func-eval”, “property evaluation”, “prop eval”) is the ability for a debugger to have the debuggee call a random function when stopped at a breakpoint. For eg, this lets you call functions from VS’s immediate window. Func-eval
Posted by jmstall | 12 Comments
Filed under:

Caveats about System.Diagnostics.StackTrace

The .Net frameworks provides the System.Diagnostics.StackTrace class which allows you to get a stack trace at runtime. This can be handy for diagnostic purposes such as implementing an assert dialog. However, beware of the following about the StackTrace
Posted by jmstall | 15 Comments
Filed under: ,

Why you can’t debug mscorwks when interop-debugging

Interop (aka mixed-mode) debugging allows you to debug both the managed and unmanaged portions of your app. However, even when interop-debugging, you still can’t debug the core runtime itself (most of mscorwks.dll). I briefly here that the key danger
Posted by jmstall | 11 Comments

Clearly Document Object Lifespans

I’ve started commenting on API design lessons we’ve learned from mistakes in ICorDebug. I previously blogged about dangers of doing complicated work in IUnknown::Release or C++ destructors. Another API design point is [update: include 2nd half of sentence]:
Posted by jmstall | 4 Comments
Filed under:

Quiz about Object.Equals()

I posted a quiz about C# equality here . It focused on equality via operator== and had questions like “what does this evaluate to: ((float) (int) x == (int) (float) x)”. The key takeaway from the quiz was that after you account for reference vs. value
Posted by jmstall | 5 Comments
Filed under:

Answers to C# Equality quiz

Here are answers and commentary for the quiz that appeared here . The quiz is what do each of the C# expressions below evaluate to (in an unchecked context), given that x is a local variable of type ‘int’. With each case, the key is to understand what’s
Posted by jmstall | 2 Comments
Filed under:

Quiz about C# and object equality.

Here’s a silly little C# pop-quiz about equality. Given a local variable x declared of type ‘int’, what do the following C# expressions evaluate to? x == x (object) x == (object) x (System.Object) x == (System.Object) x (int) (object) x == (int) (object)
Posted by jmstall | 13 Comments
Filed under:

Managed Debugging doesn’t support Fibers

Although managed-debugging definitely supports multi-threaded debuggees, it does not support debugging processes with fibers. The V2.0 CLR provides fiber support, however the ability to debug fiber-mode applications was cut . There are a few reasons that
Posted by jmstall | 9 Comments
 
Page view tracker