Managed dumps
- Hello, I'm interested in new features in Visual Studio 2010, especially in debugging of managed dumps. I have configured JIT to capture dump automatically as is described here:
http://blogs.msdn.com/clrteam/archive/2009/10/15/automatically-capturing-a-dump-when-a-process-crashes.aspx
Then I created WPF application in .NET 4.0 which function is to rise an exception. I run it and I got a dump file. I expected I will see locals and code with marked line where exception occurred like here:
http://blogs.msdn.com/tess/archive/2009/06/16/first-look-at-debugging-net-4-0-dumps-in-visual-studio-2010.aspx
but I don't see there that huge green arrow. When I click on that small on the right side (managed mode) I can see stack frames, but I don't think those frames are managed ones. How can I capture managed dump from .NET 4.0 application, open it in Visual Studio 2010 and see code when exception occurred as well as local variables?- Moved byKarel ZikmundMSFTThursday, November 05, 2009 5:12 PMBetter forum (From:Building Development and Diagnostic Tools for .Net)
- Edited byKarel ZikmundMSFTThursday, November 05, 2009 4:50 PMAdd links
Answers
- Hello,
First of all, Tess's blog post is referencing Visual Studio 2010 Beta1, the "huge green arrow" has been removed from Beta2, now you need to use the "Debug with Mixed" hyperlink on the right side of the page. If you selected "Debug with Native Only" that would produce the behavior that you are seeing. Also, you need to verify that symbols have loaded correctly by checking the Modules Window (Debug->Windows->Modules) once you are debugging. If you would like to see a video demonstrating Managed Minidump debugging using Beta2, it begins at the 14:45 mark of this channel 9 video: http://channel9.msdn.com/shows/10-4/10-4-Episode-34-Debugger-Enhancements-and-Improvements/
It is possible that somehow the dump file was not created correctly as well, and so a couple of thoughts on creating the dump. If you are simply interested in playing with the feature and have no need to automatically capture dumps, the simplest and most reliable way to capture a dump for your own application is to run it under the debugger (F5), and when it crashes use the Debug menu to "Save dump as...".
If it is not your own application, or you cannot run it under the debugger, attach Visual Studio to the process (Tools->Attach to Process), and when the application that the Visual Studio debugger is attached to crashes, Visual Studio will pop up a dialogue asking if you would like to break or continue, select "Break" and "Save dump as..." from the debug menu. Dumps can also be created from the Process tab in Task Manager by right clicking and selecting "Save Dump".
Also, only dumps of .NET 4.0 processes can be debugged using Visual Studio, if your dump was of a 3.5 or earlier process, then it will be native only debugging inside Visual Studio.
Hope that helps!
Best Regards, Andrew Hall. Visual Studio Debugger.- Marked As Answer byRoahn LuoMSFT, ModeratorTuesday, November 10, 2009 3:46 AM
- Proposed As Answer byKarel ZikmundMSFTFriday, November 06, 2009 5:18 PM
All Replies
- I didn't try it myself, but the second link (Tess's blog post) shows step-by-step guide how to do it.
Do you have your app compiled as debug?
> 3. Mileage varies depending on if your app is compiled debug, you have source lined up etc. If the app is not compiled debug you will not get things like locals or source synchronization.
If it still doesn't work for you, can you post here a simple repro (the smaller the better) and some links to screenshots how it didn't work?
Also which version do you use? Beta1 or Beta2?
Thanks,
-Karel - I use Visual Studio 2010 Beta 2. Application is compiled to debug and target platform is set to any CPU. (I tried also x86 - it is on one screenshoot.) My machine is x64 as well as OS. Screenshoots are here:
http://th7y6a.bay.livefilestore.com/y1pPn8qVKM1l8dF4aPyorC9BiElrgW6D2lUUfkrroBZGoHnxOogAEim3v3sMUYYyg6KHafYj40RlzAa3bZJMN3O23Hqrl9D3r8j/001.png
http://th7y6a.bay.livefilestore.com/y1p4FgP-PiyhDbptXVDlgCOE-kkv6TyiapWsI6eCRvJgUtozfD5wQ92by6adU-47RTm3xBKgXBO6gdOyTAXBvO4zTPloRT5KvWi/002.png
http://th7y6a.bay.livefilestore.com/y1p2o5ZcpdrxLcDFtImGNs13dyrhPIo5RYVyzhc88p6O-A_OBHpgVBap4uMbiiuF-7PoAaMbwMcz5846fCSyxqj5E6S3SZUgHOc/003.png
http://th7y6a.bay.livefilestore.com/y1pjJgaFUra6rYX11Y1sPaJJzFCI-ZXXZufnJQdEaZY74MUw1_C0C4oLWrU8Qa85v7ZCaU9jiH9waKaFmUI2tRKXgQfM6VExjeh/004.png
Thank you,
Vašek - Hello,
First of all, Tess's blog post is referencing Visual Studio 2010 Beta1, the "huge green arrow" has been removed from Beta2, now you need to use the "Debug with Mixed" hyperlink on the right side of the page. If you selected "Debug with Native Only" that would produce the behavior that you are seeing. Also, you need to verify that symbols have loaded correctly by checking the Modules Window (Debug->Windows->Modules) once you are debugging. If you would like to see a video demonstrating Managed Minidump debugging using Beta2, it begins at the 14:45 mark of this channel 9 video: http://channel9.msdn.com/shows/10-4/10-4-Episode-34-Debugger-Enhancements-and-Improvements/
It is possible that somehow the dump file was not created correctly as well, and so a couple of thoughts on creating the dump. If you are simply interested in playing with the feature and have no need to automatically capture dumps, the simplest and most reliable way to capture a dump for your own application is to run it under the debugger (F5), and when it crashes use the Debug menu to "Save dump as...".
If it is not your own application, or you cannot run it under the debugger, attach Visual Studio to the process (Tools->Attach to Process), and when the application that the Visual Studio debugger is attached to crashes, Visual Studio will pop up a dialogue asking if you would like to break or continue, select "Break" and "Save dump as..." from the debug menu. Dumps can also be created from the Process tab in Task Manager by right clicking and selecting "Save Dump".
Also, only dumps of .NET 4.0 processes can be debugged using Visual Studio, if your dump was of a 3.5 or earlier process, then it will be native only debugging inside Visual Studio.
Hope that helps!
Best Regards, Andrew Hall. Visual Studio Debugger.- Marked As Answer byRoahn LuoMSFT, ModeratorTuesday, November 10, 2009 3:46 AM
- Proposed As Answer byKarel ZikmundMSFTFriday, November 06, 2009 5:18 PM
- Hello,
I tried another situations and my result is that it works only when I have Commom Language Runetime Exceptions checked to Thrown and I save dump as file. Then it will show code with marked line, local variables and callstack. It's fine! But I would like to generate this dump when my application on customer's machine shuts down. When I have the dump generated by JIT, there is no exception information "An exception came from the CLR". Other thing I observed is that no callstack and code are shown when I debug application normally under Visual Studio 2010 Beta 2 with unchecked Thrown in Commom Language Runetime Exceptions. I see even less compare to dump generated by JIT. I'm confused and I don't know where is the mistake.


