Debugger Type = Auto for C++ projects
We frequently get support calls due to breakpoints not being hit. There are lots of possible reasons why this can occur. Today I would like to talk about one of those – using the 'auto' debugger type. Here is the basic idea of how auto works:
Open the debuggee as a file
Crack the image file headers
Look for the IMAGE_COR20_HEADERIf the IMAGE_COR20_HEADER directory is there, and the flags have COMIMAGE_FLAGS_ILONLY set, then we only debug the managed code in the process. This is what happens for your C#/VB applications.
If the IMAGE_COR20_HEADER directory is there, but the IL ONLY flag isn't set, then we do mixed mode debugging. This is what happens for a Managed C++ application.
If the IMAGE_COR20_HEADER directory is not there at all, then we do native only debugging. This is what happens for everything else.
'Auto' gets users into trouble when they are trying to set breakpoints in dlls. Since auto only looks at the exe, it doesn't care that you are using a managed dll from a native only exe – you are still going to do native only debugging. My suggestion is to not use 'auto', but rather manually pick the debugger type.
Steve commented on this as well (https://blogs.msdn.com/stevejs/archive/2004/05/05/126497.aspx).
Comments
Anonymous
July 09, 2004
Thanks for the explanation! We have an unmanaged app which loads the CLR at runtime to run some managed code. In that scenario, we always get 'Auto' as the default debugger type, although we certainly want 'Mixed' instead.
Is there a way to change the default for the debugger type to "Mixed"? Some magic registry key, maybe? (Yes, I know you can change it in a project, but that's not what I'm looking for.)
ClausAnonymous
July 12, 2004
The debugger team doesn't actually own this code, so I am not the most definative expert on this subject, but it doesn't look like it. You could try Peter (http://blogs.msdn.com/peterhu/). He could tell you for sure.Anonymous
July 23, 2004
c++ projectsAnonymous
January 21, 2009
PingBack from http://www.keyongtech.com/2318984-strange-debugger-problemsAnonymous
June 16, 2009
PingBack from http://fixmycrediteasily.info/story.php?id=1525