About debug a managed executable

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!!!

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

clr!RunMain:
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