Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VC++ Debugger DLL Unloaded??

Posted on 2006-07-06
2
Medium Priority
?
486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

610 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