Welcome to MSDN Blogs Sign in | Join | Help

February 2005 - Posts

Don’t do “complicated” work in Release().

BradA has been talking about API design guidelines, which reminds me of a bunch of subtle API design lessons we’ve learned from mistakes made in ICorDebug. I’ve started a list and it’s depressingly long. As I blog about these, I’ll pull samples from ICorDebug,
Posted by jmstall | 9 Comments
Filed under: ,

Debugging any .Net language

The CLR is a cross-language platform, so it follows the CLR-debugging services are also cross-language. This means any 3 rd -party can write their own managed debugger, and that can debug any managed app produced by any 3 rd -party compiler. (This holds
Posted by jmstall | 7 Comments
Filed under: ,

Tool to allow inline IL in C# / VB.Net

C# doesn’t support inline IL. As an experiment, I wrote a post-compiler tool that allows primitive IL inlining for C# / VB.Net (or any .net language). (My main goal here was I actually wanted to try out fxcop and needed some pet project to do it with
Posted by jmstall | 32 Comments
Filed under:

3rd-parties and Edit And Continue (Part 2: Debuggers)

I recently blogged about what’s involved for 3 rd -parties doing Edit-and-Continue (EnC ), where I explained EnC is an IDE (at least debugger+editor+compiler) wide feature, not just a debugger feature. In that entry, I alluded to some basic work a 3 rd
Posted by jmstall | 4 Comments

3rd-parties and Edit-and-Continue (Part 1: Editors + Compilers)

I’ve said before that any 3 rd party debuggers can add Edit-And-Continue (EnC) support, and now I want to be very clear exactly what that means. I’ve found people mean two different questions here: 1) Managed debugging is language neutral, so how can
Posted by jmstall | 13 Comments

What if you do attach both a managed and native debugger simultaneously?

I mentioned that you can’t have both a managed and native debugger attached to the same process . But I also mentioned that we can’t always enforce that. So the natural question arises: what if you do attach a managed and native debugger to the same process?
Posted by jmstall | 2 Comments

Rick Byers has started a blog!

Rick Byers has started a blog (actually, he's had it for about a week now)! Check out http://blogs.msdn.com/rmbyers/ . Rick is another developer on the CLR debugging services. He knows a lot more theory then I do, and has the most experience actually
Posted by jmstall | 0 Comments

Easily passing Managed strings to Unmanaged code (round 2)

My previous blog entry was about passing Managed strings to unmanaged code. Not being very interop-savy, I came up with a method and concluded there must be a better way – and lots of people quickly let me know there was (especially Nicholas Allen, jiangsheng
Posted by jmstall | 0 Comments
Filed under:

Winforms + Mdbg threading issue

In this blog entry, I’ll explain how the Winforms UI on top of MDbg handles the plumbing and threading with the shell. Why build a gui on top of the shell? The MDbg shell provides a lot of functionality (such as all the shell commands) that a UI could
Posted by jmstall | 3 Comments
Filed under:

Hardmode vs. Softmode

User-mode debugging can be split into 2 models: Hardmode and Softmode. Hardmode means using the native debugging APIs. This means all threads are stopped by the OS at each debug event and there’s no helper-thread . The debugger does not need to run any
Posted by jmstall | 6 Comments

Compiler Lab Results

Microsoft has been having a .Net compiler lab from Feb 7 to Feb 9. It looks like it’s been going very well, so kudos to the organizers. I’ve had a chance to talk to a few people about clr debugging and they’ve asked some great questions. Here’s a sampling,
Posted by jmstall | 2 Comments

Source for a C# compiler written in pure C#.

For anybody looking for the full source to a bootstrapping C# compiler, today’s your lucky day. A while ago (back in 2001 before we shipped v1.0), I wrote a C# compiler called “Blue”. I know it’s 3.5 years after I wrote it, but I figured releasing it
Posted by jmstall | 48 Comments

Source is available for MDbg Winforms GUI!

The source for the Winforms GUI extension to MDbg is now available as a sample. (Sorry it took so long). The download is available here . I’ve also updated the original post with this link. Here's a screenshot of the updated gui:
Posted by jmstall | 21 Comments
Filed under: ,

Why you can’t do Edit-and-Continue on Dynamically generated code

I gave a brief example of how you can debug dynamically generated code (e.g., code generated via Reflection.Emit). Jamie Cansdale observed that you can’t use EnC with dynamically generated code. This was a conscious choice. Here are some reasons for it:

Debugging Dynamically Generated Code (Reflection.Emit)

The CLR supports the ability to generate code at runtime (Reflection.Emit). This is great for the many dynamic languages targeting the runtime (such as Iron Python ). We also support that ability to provide debugging information for that code so that
Posted by jmstall | 27 Comments

Implementing ICorDebug to reuse existing debuggers?

I usually talk about people writing debuggers to consume the ICorDebug API and debug CLR applications. Nathanael Presson asked me the exact inverse question: … my concern is not to write a debugger for managed code, but to make my own self cooked .net
Posted by jmstall | 8 Comments
Filed under:
 
Page view tracker