Solved

VC++ Debugger DLL Unloaded??

Posted on 2006-07-06
2
470 Views
Last Modified: 2008-03-10
On the output of an application that is running in debug mode.  It will show when the dll's are loading and unloading.  Is this accurate?  When the Output section shows a.dll unloaded.  Is a.dll completely finished unloading.  Is it starting to unload.  If an exception happens and the output says a.dll unloaded is it safe to assume the exception has nothing to do with a.dll since it is 'unloaded'.  

Is any of this accurate.  Or is the debugging output not an accurate measure for when dll's are loaded and unloaded?
0
Comment
Question by:cophi
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 17052749
Yes, that is correct. When the debugger reports a DLL as 'unloaded', it's reference counter (which is increased with 'LoadLibrary()' and decreased with 'FreeLibrary()') has dropped to zero and the DLL is unmapped from the process' memory.

Yet the exception might have to do with some code in the process trying to access code or data in the DLL that has previously been unloaded.

BTW, you might want to double-check that with the DependencyWalker (www.dependencywalker.com) in 'Profile Mode'. The log file that it creates is veryuseful in diagnosing faulty behaviour.
0
 
LVL 86

Expert Comment

by:jkr
ID: 17052886
As a side note - these messages are generated based on a 'UNLOAD_DLL_DEBUG_EVENT' that the debugger receives through 'WaitForDebugEvent()', see http://msdn.microsoft.com/library/en-us/debug/base/debug_event_str.asp ("DEBUG_EVENT") and http://msdn.microsoft.com/library/en-us/debug/base/unload_dll_debug_info_str.asp ("UNLOAD_DLL_DEBUG_INFO").
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question