views:

40

answers:

1

I'm trying to debug a .NET 3.5, 32 bit application running on Windows 7/64 bit with WinDbg. I'd like to use psscor2, but I can't load it. I can't load sos, either.

When I try to load psscor2, I get this error:

> .load psscor2
The call to LoadLibrary(psscor2) failed, Win32 error 0n193
    "%1 ist keine zulässige Win32-Anwendung."
Please check your debugger configuration and/or network access.

When I try to load sos, I get this error:

> .loadby sos mscorwks
Unable to find module 'mscorwks'

My guess is that the 64bit version of WinDbg can't load 32 bit extension dlls like psscor2 and sos. But I couldn't find a download for the 32 bit version of WinDbg, or a 64 bit version of psscor2.

PS: I have (sort of) solved the problem: I installed the Windows 7 SDK in a 32 bit virtual machine, and copyed the 32 bit version of WinDbg from there to my development PC. But there has to be a easier way to do this!

+1  A: 

If you want to debug a 32 bit application, you should use the 32 bit version of WinDbg and load the 32 bit version of SOS/PSSCOR2 even if you're on 64 bit Windows.

If you use the 64 bit version, you'll end up debugging the Wow64 process, which means you must go through some additional loops to be able to debug the application as a 32 bit process. If you must do this for some reason, you need to load the wow64exts extension as well and switch to 32 bit mode using the !sw command. Even if you do this there are some issues with using the 64 bit version with a 32 bit application, so I recommend that you use the 32 bit version of WinDbg.

Brian Rasmussen
@nikie: Sorry I was in the middle of updating my answer. If you want to debug a 32 bit app on 64 bit Windows you should use the 32 bit version of WinDbg/SOS. Please see my answer for details.
Brian Rasmussen
Hm, then I'm probably too dumb to use the WinDbg download site. When I go to http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx, I get the same installer file that installs the 64 bit version (and only the 64 bit version) of the development tools.
nikie
@nikie: Unfortunately, Microsoft has changed the distribution of WinDbg a couple of times recently. If you get the ISO image of the WDK, you'll find all the installers for the different versions.
Brian Rasmussen