Updating MDbg GUI for Beta 2

I had a sample GUI extension for Mdbg Beta 1. However, it doesn’t build with Mdbg Beta 2 because:
    1) we renamed some of the mdbg dlls.  
    2) it depends on mdbg.snk (strong name key)  from the mdbg beta 1 sample which is not included in the beta 2 sdk.
    3) [updated] another general issue updating from beta1 to beta 2 is that Mdbg beta1 uses ISymbolBinder from mscorlib; and Mdbg beta2 now defines its own symbol binder wrappers.

I just got around to trying out the GUI with MDbg Beta 2 in the SDK, and it only took about 2 minutes to update. I’ll eventually update the sample, but for those that want to run it now, here’s what you do:
 1) Unzip the files to some directory.
 2) Run ‘gui.csproj’ in VS Whidbey Beta 2. One way to do this is just double-click it in explorer. VS is smart and will build a solution around this project.
 3) Fix the references
        3a) Go to the “references” node for the “Gui” project in the “Solution Explorer”.
        3b) remove the old mdbg references (corapi.dll, corapi2.dll, mdbgeng.dll, mdbgext.dll).
        3c) add a reference to mdbgcore.dll from the Beta 2 sdk.
 4) Fix the signing. The gui depends on “mdbg.snk” from the mdbg beta 1 sample, which is not included in the Beta 2 SDK. You can solve this two ways:
        4a) Go to “Project | Gui Properties | Signing” and uncheck “Sign the assembly”. 
        4b) alternatively, you can supply another strong name key file (or copy the mdbg.snk from the beta 1 sample). You can supply a file via the combo box under “Choose a strong name key file”.
 5) Build it. It should build with 0 errors. Though you will get a bunch of warnings about “System.Windows.Forms.Form.AutoScaleBaseSize” being deprecated.
 6) Run it!
        6a) Since the gui is a dll, you’ll need to run mdbg.exe from the SDK first.  Go to “Project | Gui Properties | Debug” and set the “Start Action” radio button to be “start external program” and set that to be Mdbg from the sdk. It will probably be at a location like “C:\Program Files\microsoft visual Studio 8\SDK\v2.0\Bin\Mdbg.exe”
        6b) F5 to run Mdbg. 
        6c) Now in the mdbg shell, do “load gui”. This should pop up the gui dialog and you’ll be set to go.

[Update 8/18/05:] This just tells how to rebuild the sample. However, something has changed between beta1 and beta2 that causes the dialogs to misbehave. So when you open a dialog in beta2, you get complaints about ThreadState or STA. I'll try to update the sample for beta 2 soon and update it.

Comments

  • Anonymous
    June 07, 2005
    I'm interested in the IL debugging feature available with MDbg. VS 2005 Beta 2 / .NET Framework SDK 2.0 Beta 2 ships with Mdbg but does not include the source for Mdbg, nor does it currently include the ILDasm extension DLL. Fortunately, you can (and I tried this successfully), follow the above basic steps suggested by Mike above to get IL debugging working.
    First, obtain the source code for Mdbg (http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28-80ce-c55645ab1310&displaylang=en). One of the folders in the source tree is Extensions and a subfolder of that is Ildasm. Get the ILDasm files and follow the steps Mike suggested for getting the Mdbg GUI to work, only apply them to ILDasm source files. If you copy your ILDasm source to a separate folder then you'll need to reset the reference to versionInfo.cs. Do a rebuild all. Copy the resulting ILDasm.dll to the same folder where MDbg.exe exists (for me, this is C:Program FilesMicrosoft Visual Studio 8SDKv2.0Bin). Now you can follow Mike's brief instructions at http://blogs.msdn.com/jmstall/archive/2005/02/19/376666.aspx to debug the IL.
  • Anonymous
    August 10, 2005

    The Mdbg (a managed debugging written in pure C#) sample, which includes full source, has now been...
  • Anonymous
    August 10, 2005

    The Mdbg (a managed debugging written in pure C#) sample, which includes full source, has now been...
  • Anonymous
    August 27, 2005
    At this point, I've got what seems to be an endlessly long list of things I'd like to eventually blog...