Mike Stall's .NET Debugging Blog

Notes on Managed Debugging, ICorDebug, and random .NET stuff

Browse by Tags

Tagged Content List
  • Blog Post: OpenSource CSV Reader on Nuget

    I did some volunteer work a few years ago that required processing lots of CSV files. So I solved the problems by writing a C# CSV reader, which I wanted to share here. The basic features here are: be easy to use read and write CSV files (and support tab and “|” delimiters too) create CSV files around...
  • Blog Post: RTS Battle simulation with IronPython

    I used Python to simulate Age of Empires archer battles. I wanted to be able to answer questions like: If 12 archers attack 10 archers, what will the margin of victory be? If two armies of the same size attack each other, how do different strategies affect the outcome? This also led to some...
  • Blog Post: Why is System.Diagnostic.Debugger class compiled in retail?

    There's a good reason that methods on a "System.Diagnostics.Debugger" class are still compiled in retail builds, although this occasionally surprises folks. Here's why... Background: The System.Diagnostics.Debugger class provides some useful low-level debugging APIs such as: Debugger.Break () - causes...
  • Blog Post: Paradigms around Debugging Memory leaks

    In native code, memory is explicitly managed by the program calling Malloc()/Free() (or comparable APIs). In managed code, there's a garbage collector (GC). A GC does not mean that you no longer get memory leaks . It just means that runtime calls Free() for you at some arbitrary point after the runtime...
  • Blog Post: Foreach codegen

    Do you know how the following C# code compiles? foreach ( int i in c) { Console .WriteLine(i); } In addition to the obvious branching opcodes, this can also emit try/finally, a call to IDisposable, unboxing opcodes. It turns out it really depends on the type of C. There are 4 interesting cases: If C...
  • Blog Post: Setting transparency in an image

    Just as Jackie Chan does his own stunts; I do my own image drawing. Some of my "art": (The yellow arrow here ). The shapes in my Silverlight 1.1 app : The astute observer probably noticed that all of my work is very primitive and done in MS Paint (yup, "%windir%\system32\mspaint.exe") . Paint is fast...
  • Blog Post: Building and Debugging Powershell cmdlets in the VS IDE

    Here's how you can get a sweet Visual Studio development experience for building and debugging your own PowerShell cmdlet: - It has Wizard support for initially creating the cmdlet, - intellisense - F5 build support which also registers your cmdlet - provides the full power of the VS debugger including...
  • Blog Post: Some tips for P/invoke

    Here are some tips I've learned the hard way after wrapping some nasty things into managed code (including wrappers for the native debugging API and reading minidumps): Use resources like Pinvoke.net and Fxcop (which may have some useful marshalling checking rules). Beware of 32-bit vs. 64-bit...
Page 1 of 1 (8 items)