Welcome to MSDN Blogs Sign in | Join | Help

September 2005 - Posts

It's been a year

It's been about a year since I first started blogging . At first, I wasn't sure if I should do it because I couldn't think of what to blog about and I didn't think I'd have anything interesting to say . I remember asking Andy Pennell , Steve Steiner ,
Posted by jmstall | 1 Comments
Filed under:

I'm caught up!

Ok. With that last post , I believe I've completely caught up with all outstanding private emails requests. If you sent me a private email via the contact link on this blog, and none of my recent posts answer it, then odds are a) the spam filters ate
Posted by jmstall | 0 Comments
Filed under:

Symbol API (CorSym.idl) for managed PDBs

From the mailbag: Just wanted to know if there are plans to ever give us world citizens an API to modify & emit pdb files, at least for managed assemblies. Good news. You've already got them. 1) The CorSym.idl API (exists in sdk, next to where you
Posted by jmstall | 1 Comments
Filed under:

Enable vs. Implement

There's a key distinction between a platform (like the CLR debugging services) enabling a scenario instead of actually implementing the scenario. Implementing a scenario means we provide specific functionality for a scenario. For example, the CLR debugging
Posted by jmstall | 0 Comments
Filed under:

Debugger.Log and LogMessage

Calls to Debugger.Log in a debuggee can generate a ICorDebugManagedCallback::LogMessage managed debug event. This is the managed equivalent of kernel32!OutputDebugString . Other managed functions (like Debug.Write ) may degenerate to calls to Debugger.Log
Posted by jmstall | 4 Comments
Filed under:

Compiling a language to C#

Several people have written me to say that they're writing their own language (let's say 'X') and they compile their language to C# and then compile C# to IL. This is instead of directly compiling X to IL. This can be attractive because: 1) using C# constructs
Posted by jmstall | 12 Comments

Having debugger-friendly codegen

One of the things I like about C# anonymous delegates is that the codegen is clever enough that they're reasonably debuggable without any additional debugger support. This type of debugger-friendly codegen is a key part in making your 3rd-party language
Posted by jmstall | 0 Comments

MDbg Sample temporarily broken in post-beta 2 builds.

Customers have alerted us that the MDBg sample is broken on post-beta 2 builds. Rick Byers has diagnosed the problem as an issue in the mdbg build and we're working to update it. I guess there was a VS change that exposed this problem. Rick may blog a
Posted by jmstall | 6 Comments
Filed under: ,

F5 vs. Ctrl-F5

In VS, F5 will launch your application under the debugger. Under the debugger, you'll hit breakpoints, be able to edit-and-continue, and do all the debugger things you know and love. Ctrl+F5 will launch your application outside of the debugger. This is

Process X can't tell if Process Y is being managed debugged.

From the mail bag: Is there a way to determine if a managed debugger is already attached to a given process id? It looks like ICorDebug.CanLaunchOrAttach might be the right API for this (wouldn't it return FALSE if another debugger is already attached?).
Posted by jmstall | 2 Comments
Filed under:

Going from IL to Source

Question from the mail bag: I am trying to get some information on what I can do usefully with the "+ 0xnn" part at the end of a call stack line in VS IDE 2003. So when I see (in the call stack window) cf-gfmaa!Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write3_ArrayOfExtendedAnnotationElement(System.Object
Posted by jmstall | 1 Comments
Filed under:

ICorDebug reentrancy

ICorDebug (ICD) in managed-only debugging mode does not need to be a reentrant API . In other words, you can imagine all of ICorDebug being under a single giant monitor (lock). This also means that all calls to ICorDebug will return without blocking on
Posted by jmstall | 2 Comments
Filed under:

ICorDebug, MTA, STA.

ICorDebug (ICD) is a com-classic interface. In terms of COM threading models , ICorDebug is technically free-threaded (aka, should reside in the "neutral apartment"), which means that it manages its own threading. We go through great pains in the ICD

Types of Names

We've had some design discussions where we've come across 4 types of string names. These terms came mostly from discussing debugging symbols, but they extend to naming in general. Type Example for function Example for filename Fully qualified names (FQN):
Posted by jmstall | 0 Comments
Filed under:

Out-of-band events and Mixed-mode debugging

Interop-debugging splits all debug events into "In-band (IB) " and "Out-of-band (OOB)". Inband events are the good ones: at an inband event, the debuggee is stopped and you can use the rest of the ICorDebug API normally to do inspection and other things
Posted by jmstall | 2 Comments

Commutative vs. Associative

Sometimes a good example can instantly clarify something. I recall back to my early school days when my math teacher explained that addition and multiplication were Commutative (a+b == b+a) and Associative ( a+(b+c) == (a+b) +c). We students didn't really
Posted by jmstall | 9 Comments
Filed under:

IL offset 0 vs. Native offset 0

Within a function, offset 0 into the native code stream corresponds to the very first native instruction in that function. Since the function is ultimately executed via native code (and not via interpreted IL), it's safe to say that native offset 0 corresponds
Posted by jmstall | 5 Comments

MC++ / IJW codegen for Native structures in IL

When MC++ compiles an "unmanaged" class into IL (from IJW), it actually compiles the class into an opaque blob and then uses pointer arithmetic to access the fields. The code is not verifiable, but it's still IL. This is exactly how it would codegen if
Posted by jmstall | 0 Comments

Managed C++ codegen for new, array manipulation, delete

Managed C++ (MC++) code generation is a cool accomplishment. I think it's another good testimony to the CLR's cross-language charter (and IL's flexibility) that we can support C++. (Not too mention our support for more dynamic languages like F# , SML.Net
Posted by jmstall | 12 Comments

How can I tell if I'm interop-debugging?

Sometimes I'm debugging and I want to make sure that I'm actually interop-debugging and not accidentally managed-only debugging. (Now that interop-debugging is so much faster and more stable in whidbey, it's easy to forget you're doing it). One way is
Posted by jmstall | 2 Comments

Example of Goofy bugs

Here's an sampling of various goofy bugs we've had to deal with in the CLR Debugging services over the past. I mention these so that you can consider whether most of the hot "silver-bullet" testing / software development technique would ever catch bugs
Posted by jmstall | 4 Comments
Filed under:

How to embed IronPython script support in your existing app in 10 easy steps

Previously , I added IronPython scripting support to a real existing application, MDbg (a managed debugger written in C#). In this entry, I'll go through step-by-step how I did that. I'll call specific attention to the goofy issues so that it should be
Posted by jmstall | 17 Comments
Filed under:
 
Page view tracker