Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

More Info on Driver Writing and Debugging

The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.

Check out The OSR Learning Library at:

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

About debug a managed executable

yu_shangyu_shang Member Posts: 13

I'm trying to debug a 32-bit managed executable (msbuild.exe) , I've tried 2 scenarios

debug with 64-bit windbg

can‘t load the sos.dll

0:000>bp clr!RunMain
0:000:x86> .cordll -l
CLR DLL status: No load attempts

debug with 32-bit windbg

can load the sos.dll, but the dumpmd does not work

0:000>bp clr!RunMain
0:000> .cordll -l
CLR DLL status: Loaded DLL C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll
0:000> dd @esp+4 l1
00aff4f0  00aff52c
0:000> !dumpmd 00aff52c
00aff52c is not a MethodDesc

how does this happen? Many thanks!!!


  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,450

    Looks like RunMain is fastcall and so the method descriptor is in ECX:

    74ea7ef1 68f8000000      push    0F8h
    0:000> .cordll -l
    CLR DLL status: Loaded DLL C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll
    0:000> !dumpmd @ecx
    Method Name:  Microsoft.Build.CommandLine.MSBuildApp.Main()
    Class:        79096010
    MethodTable:  7915b3d8
    mdToken:      060000b3
    Module:       79081000
    IsJitted:     yes
    CodeAddr:     7912b0b8
    Transparency: Critical


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 27 September 2021 Live, Online
Kernel Debugging 15 November 2021 Live, Online