2

I'd like to call a .NET method while debugging a .NET application with WinDbg / SoS.

The concrete issue is that the method .ToString() of an object generates relevant information for debugging. Obtaining this information manually can be tricky. So I'd like to call and obtain the results of a .NET method from WinDbg, in this case .ToString. I think that calling other methods can be useful too.

Nekketsu
  • 121
  • 2
  • 12
  • 1
    Possible duplicate of (unanswered) http://stackoverflow.com/questions/7151301/is-it-possible-to-call-a-method-from-windbg-sos – Thomas Weller Dec 12 '16 at 13:31
  • 1
    It's probably not so simple. `.call` can rely on a method that was already compiled. With .NET it may happen that the JIT compiler did not compile the IL code yet. – Thomas Weller Dec 12 '16 at 13:34
  • Within Visual Studio is very easy to add "Watches", or use the "Immediate Window", or "C# Interactive", etc, to see the result of a .NET method call. How could it be accomplished with WinDbg? – Nekketsu Jul 17 '18 at 11:06
  • 2
    It's very hard in WinDbg. WinDbg was simply not made for .NET. – Thomas Weller Jul 17 '18 at 16:32

0 Answers0