Welcome to MSDN Blogs
Sign in
|
Join
|
Help
Mike Stall's .NET Debugging Blog
Notes on Managed Debugging, ICorDebug, and random .NET stuff
This Blog
Syndication
RSS 2.0
Atom 1.0
Search
Go
Tags
binary_diff
Compilers & Languages
Design
dlr
Edit-And-Continue (EnC)
Family
feedback
FuncEval
ICorDebug
Interop (mixed-mode)
interview
linkfest
MDbg
Non-work
Quiz
Random
random .net
reading
Sample Code
Silverlight
Testing
This should be in MSDN
Troubleshooting
versioning
Whidbey (V2.0)
Windows Live
wishlist
Archives
April 2008 (3)
March 2008 (5)
February 2008 (2)
January 2008 (10)
December 2007 (7)
November 2007 (5)
October 2007 (16)
September 2007 (8)
August 2007 (12)
July 2007 (9)
June 2007 (5)
May 2007 (7)
April 2007 (4)
March 2007 (6)
February 2007 (5)
January 2007 (10)
December 2006 (9)
November 2006 (13)
October 2006 (9)
September 2006 (9)
August 2006 (6)
July 2006 (13)
June 2006 (9)
May 2006 (3)
April 2006 (4)
March 2006 (31)
February 2006 (16)
January 2006 (18)
December 2005 (11)
November 2005 (23)
October 2005 (12)
September 2005 (22)
August 2005 (28)
July 2005 (10)
June 2005 (7)
May 2005 (4)
April 2005 (5)
March 2005 (9)
February 2005 (16)
January 2005 (6)
December 2004 (3)
November 2004 (4)
October 2004 (14)
September 2004 (2)
CLR blogs
David Notario (JIT Compiler)
Rick Byers (CLR)
Jonathan Keljo's blog
List of all CLR blogs
David Broman (Profiling)
Thomas Lai's blog
Other Blogs
Andy Pennell's Blog
GreggM's Blog
Steve's Blog
Tim's .NET blog for web developers
Other links
All about MDbg
What's new in v2.0?
Who am I?
ICorDebug/MDbg Forums
Contact me?
August 2005 - Posts
Wednesday, August 31, 2005 9:46 PM
Adding IronPython scripting engine to Mdbg
I hear IronPython is a great managed scripting language to embed in other managed apps, so I thought I'd try this out by writing an MDbg Extension to drop IronPython 0.9.1 into the MDBg Beta 2 sample. (both pieces are publicly available downloads). The
Posted by
jmstall
|
12 Comments
Filed under:
MDbg
,
Sample Code
Tuesday, August 30, 2005 4:09 PM
The importance of fortifying your subsystems.
In Writing Solid Code , Steve Maguire warns to "fortify your subsystems". This is especially important if your subsystem takes liabilities on other systems. One of our (CLR debugging teams') most common bugs from Whidbey Beta 2 is a case where we hadn't
Posted by
jmstall
|
1 Comments
Sunday, August 28, 2005 12:23 AM
What's on my blog-todo list.
At this point, I've got what seems to be an endlessly long list of things I'd like to eventually blog about. My list includes: ( Update 10/25/05 : added more hyperlinks since I've now down some of these) 1.) Brushing up on some AI: A coworker lent me
Posted by
jmstall
|
3 Comments
Filed under:
Random
Saturday, August 27, 2005 2:54 AM
Boring blogs?
Some of you are probably wondering why I sometimes blog on such strange topics. Great question! There are lots of reasons: 1.) My area of expertise (ie, the only thing I know more than you about) is the CLR Debugging Services. Based off blog comments
Posted by
jmstall
|
12 Comments
Filed under:
Random
Thursday, August 25, 2005 2:49 AM
Converting a managed PDB into a XML file.
I wrote some C# sample code to get an ISymbolReader from a managed PDB (Program Database) file and then dump it back out as XML. The managed PDB stores all the source-level debugging information such as: - the mapping between IL offsets and source lines.
Posted by
jmstall
|
11 Comments
Filed under:
MDbg
,
Sample Code
Tuesday, August 23, 2005 5:29 PM
ICorDebugStepper and using ICorDebugStepper2::SetJMC
We added Just-My-Code (JMC) stepping (the ability to step through just your code and skip code that's not yours) in Whidbey. I blogged a demo from the end-user's perspective here . In response to some email, I wanted to talk a little more about how a
Posted by
jmstall
|
4 Comments
Filed under:
ICorDebug
,
Whidbey (V2.0)
,
This should be in MSDN
Tuesday, August 23, 2005 10:19 AM
Size of Visual Studio
Ever wonder how large Visual Studio is? This public comment from the MSDN feedback gives some good stats: Visual Studio is over 43 million lines of code , there are over 30 teams working on different pieces, with roughly 700 developers checking-in code
Posted by
jmstall
|
20 Comments
Filed under:
Random
Monday, August 22, 2005 5:45 PM
Sample code for Plagiarism Searcher tool
Here's my sample code for a tool to catch blog plagiarism that I described earlier . In retrospect, it was pretty easy to write (under 400 lines!). And edit-and-continue in C# and interceptable exceptions made my development time a lot faster! The tool
Posted by
jmstall
|
8 Comments
Filed under:
Sample Code
Monday, August 22, 2005 12:41 AM
Using the clipboard as input for console tools.
The clipboard can be a very handy source of input for certain console tools. I've written some console C# tools that want to take in a large amount of text from some open document (such as a webpage or a window in my IDE). It would be annoying to have
Posted by
jmstall
|
3 Comments
Filed under:
Sample Code
Sunday, August 21, 2005 1:03 PM
Sample code to execute MSN searches from C#
For kicks, I started writing a tool to use internet searches to automatically catch plagiarism . The first thing I needed was a way to easily execute a search (I'll use MSN search ) from a C# API. Ideally, it would be a function that takes in a search
Posted by
jmstall
|
8 Comments
Filed under:
Sample Code
Sunday, August 21, 2005 12:24 AM
Tool to catch plagiarism
If you copy somebody else's blog entry verbatim, credit the original author and link back to the original post. Sometimes I'll google my own topics to learn more about what other people have to say about it. I stumbled across some blatant plagiarism.
Posted by
jmstall
|
12 Comments
Friday, August 19, 2005 4:41 PM
Why <font> is bad and easy intro for Cascading Style Sheets
I embarrassed to admit I hadn't used CSS before. I googled it, this tutorial came up, I found it quick and helpful, so I wanted to pass it along. It's a great, concise, easy-to-follow, tutorial about why the <font> tag in HTML is bad and how to
Posted by
jmstall
|
3 Comments
Filed under:
Random
Tuesday, August 16, 2005 8:59 PM
Auto-attach to child process is not supported in managed-debugging
Native-only debugging allows you to debug child processes. In other words, you can debug process A, and then if A spawns process B, your debugger can automatically start debugging process B. This eliminates the need to manually attach to process B, and
Posted by
jmstall
|
1 Comments
Filed under:
Interop (mixed-mode)
Sunday, August 14, 2005 1:22 AM
Lessons from nullable: Superstars + Feedback
Soma (my boss's boss's boss's boss) recently blogged about how the CLR took a major change to fix Nullable . There are 2 lessons here. First, this is a lesson in super-stars. Some background: this was a major change done very late in the game. That's
Posted by
jmstall
|
1 Comments
Filed under:
Random
Friday, August 12, 2005 7:22 PM
How should a generic method be displayed?
I've heard several different opinions about how the debugger should display a generic method in the callstack. Say you have a method Class<T>::Method<S>(...). Say you have 3 instances, of with (T=int, S=string), (T=int, S=object), and (T=float,
Posted by
jmstall
|
8 Comments
Filed under:
Design
,
Random
Friday, August 12, 2005 10:52 AM
Nesting C#'s yield
C#'s yield keyword is sure neat, but I notice it only lets you yield a single item. It does not let you yield another enumerator and then flatten for you. You can manually do this by having the for-each yourself. foreach(int i in GetValues()) { yield
Posted by
jmstall
|
7 Comments
Filed under:
Random
Wednesday, August 10, 2005 4:48 PM
MDbg Sample is updated for Beta 2 and RTM
The Mdbg (a managed debugging written in pure C#) sample, which includes full source, has now been updated and released. The previous sample was for beta 1. This new sample has been updated for Whidbey beta 2 and will also be compatible with the final
Posted by
jmstall
|
14 Comments
Filed under:
MDbg
,
Sample Code
Wednesday, August 10, 2005 11:28 AM
Problem: The debugger attaches too slowly:
From the mailbag: "I notice that running and attaching the debugger takes on average now 8-10 seconds for even a simple console application." I'm not a VS expert, but here are some trouble-shooting tips: 1. Try a managed-only attach instead of interop
Posted by
jmstall
|
3 Comments
Wednesday, August 10, 2005 1:07 AM
You can't get a mixed-mode callstack from inprocess.
You can't get a full-mixed (both managed+ native) stack of a thread within your own process. You can get a native-only stack from function like DbgHelp!StackWalk64 (which is what this article on Codeproject does) to get the native callstack of a native
Posted by
jmstall
|
7 Comments
Filed under:
Interop (mixed-mode)
Tuesday, August 09, 2005 11:04 AM
Implementing your own XmlReader the easy way.
Implementing an XmlReader is very difficult because there are over 25 abstract methods. Here's a simple way to change the problemspace to implement XmlReader with only 1 real method.
Posted by
jmstall
|
6 Comments
Filed under:
Sample Code
Monday, August 08, 2005 5:42 PM
Harness that Attach instead of Launch
I've given sample code for MDbg-based harnesses that launch an app and then print all loaded modules or print exceptions that occur. In both cases, the harness launches the app. One reader asked how to modify them to attach to an existing app. It's actually
Posted by
jmstall
|
7 Comments
Filed under:
ICorDebug
Monday, August 08, 2005 1:42 PM
TextReader based off C# Yield
Here's how to use C#'s yield keyword to conveniently implement a stream on top of a complex data source
Posted by
jmstall
|
4 Comments
Filed under:
Sample Code
Sunday, August 07, 2005 8:58 PM
On why C#'s "abstract-override" is so cool:
Good language design usually results in a few well defined simple primitives that can be combined together in intuitive and intelligent ways. In contrast, poor language design usually results in many bloated constructs that don't play well together. The
Posted by
jmstall
|
6 Comments
Filed under:
Random
Saturday, August 06, 2005 2:54 AM
Deriving from TextReader
TextReader is an abstract base class that represents reading a textual stream. It's like an enumerator for characters (IEnumerable<char>). Common derived classes in the frameworks include StringReader (which presents a string as a text stream) and
Posted by
jmstall
|
6 Comments
Filed under:
Random
,
Sample Code
Thursday, August 04, 2005 6:10 PM
Jonathan Keljo has started a blog!
Jonathan Keljo has started a blog ! Jonathan is a Program Manager (PM) on the CLR (which means he understands the big picture better than developers like me). He's had a major impact on the managed debugging services in Whidbey. He's been up to profiling,
Posted by
jmstall
|
0 Comments
Wednesday, August 03, 2005 1:56 PM
More caveats about #line
I posted here about how you can use #line in the C# compiler to associate C# code with some other source file than the one it was compiled with. This can be very useful for code generation and for "hiding" various parts of the function from the debugger.
Posted by
jmstall
|
5 Comments
Monday, August 01, 2005 3:42 PM
What my dog taught me about race conditions
I have a black Labrador named Sofie. She's about 2 and a half now, but still a puppy at heart. Here's a picture of her (along with her best friend, Sierra, who is a yellow lab): One morning, Sofie reminded me of a valuable issue with threading and race
Posted by
jmstall
|
9 Comments
Filed under:
Random
,
Non-work
Monday, August 01, 2005 12:13 AM
Simple example of an API design flaw.
Here’s a simple example of an API design flaw in ICorDebug. (ICorDebug is the API that Visual Studio / MDbg and other debuggers use to debug managed code). Here’s the background knowledge: 1) When a thread first executes actual IL (whether jitted or ngenned)
Posted by
jmstall
|
3 Comments
Filed under:
Design
,
ICorDebug