7

I would like to log the stack trace of all threads in my c# application (UI). I can get the stack trace of all managed threads using WinDbg with the following commands.

.loadby sos mscorwks
~* e !clrstack

Is there any other easy methods to get the callstack of all threads in my c# application? This is because I want to get the callstack when the application is running in the customer machine and the customer is not a technical person

Please help me.

Thanks!

2 Answers 2

1

Here's a suggestion try to grab a user dump of application using either Adplus+WinDbg or DebugDiag. And do a postmortem debugging using the userdump

Here's a good article about capturing user dumps automatically on process crashes

Good Reads Tess Fernandez's blog on msdn

http://debuggingblog.com/wp/2008/10/31/beginner-guide-to-windbg-part-1/

Sign up to request clarification or add additional context in comments.

Comments

1

Yes you can do it in a live process as well if you do deploy Windbg to the customer machine as well and then use WMemoryProfiler to execute a debugger command. It sounds strange but you can actually debug yourself with a debugger automaticaly.

See here:

private static void SelfDebug() { using (var debugger = new MdbEng()) { string[] output = debugger.Execute("~*e!ClrStack"); Console.WriteLine(String.Join(Environment.NewLine, output)); } } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.