Reputation: 507
I have recently switched from native to managed code programming. I am using .NET.
Since i have been using Windbg for quite some time , i want to use it for managed code debugging as well.
My search has brought me to the SOS (Son of Strike) extension, which seems to have quite some powerful commands.
Even though i understand most of the commands being used in SOS, i am unable to find a way to properly step through source code, just as i could do using the p and t instructions for native code.
This makes the debugging experience difficult, and I really want to step through code while debugging it.
I researched a bit on this and found that this was possible using the 6.7.05.0 version of Windbg in which MS seemed to have released integrated managed debugging, but rolled back in the later versions.
Nevertheless, i am very interested in being able to step through "source" code live while debugging through SOS. Specially because it is really hindering my debugging experience right now.
Is there a way to achieve this?
Any help on how to do this (or practical workarounds) is appreciated.
Upvotes: 8
Views: 5931
Reputation: 185
If what you want is to hookup source code to windbg you could follow those steps:
Upvotes: 0
Reputation: 942438
Windbg shines at analyzing minidumps of a crashed process. It is however not a managed debugger.
You can have your cake and eat it too by loading SOS in Visual Studio. Which permits using the normal debugging tools you have available in the managed debugger, plus the diagnostics you can get out of SOS. A few restrictions apply:
Start debugging and switch to the Immediate Windows. Type .load sos.dll
, you should see an message like extension C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dll loaded
. Type !help and verify that you see the SOS commands listed.
Upvotes: 6
Reputation: 3027
Try using !sosex.mt and !sosex.mgu. The 'p' command should work as advertised.
Upvotes: 8