Solved

VC++ Debugger DLL Unloaded??

Posted on 2006-07-06
2
473 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 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

Suggested Solutions

Title # Comments Views Activity
Template syntax for variable length arrays 9 78
Socket Programming (Unix) 8 157
Safe conversion? 4 84
Embarcadero C++ Builder XE10.1 Berlin red arrow Indicator 2 91
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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

740 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