Please enable JavaScript to view this site.

Coverage Validator Help

 

The Hooked DLLs tab allows you to specify which DLLs should be hooked or not.

 

The default is simply to hook everything.

 

interactiveRead on, or click on a setting in the picture below to find out more.

 

settings-hookeddlls

 

 

 

Which DLLs to hook - the hooking rule

 

By default, Coverage Validator will try to hook all DLLs and .EXEs used by your application, but you can choose to list only those which should be included or excluded:

 

Hook all DLLs instructionStep hook everything - ignoring the settings in the list

 

Hook the enabled DLLs in the list instructionStep hook only the ticked modules listed
 

Do not hook the enabled DLLs in the list instructionStep ignore all the ticked modules in the list, and hook everything else

 

 

Populating the process modules list

 

The process modules list should specify the following items to be included or excluded from hooking in the target application

 

DLLs

.EXEs

folders containing DLLs and .EXEs

 

Initially the list is empty as the default option is to hook all DLLs and ignore the list. You can add modules to the list by:

 

automatically adding modules on which your application is dependent

manually adding modules or folders

editing modules or folders already in the list

 

 

Automatic module addition

 

You can automatically populate the list with all the dependent modules for your application:

 

Choose Exe... instructionStep navigate to your application and click Open instructionStep all the process modules appear in the list

 

 

hooked-dlls-choosing-exe

 

 

Manual module addition

 

You can also manually add one or more modules or a folder to the list.

 

Add Module instructionStep navigate to the DLL or EXE and click Open instructionStep all the selected items are added

 

Add Folder instructionStep navigate to the folder and click OK instructionStep the folder is added to the list

 

Manual addition might be useful for example if you use LoadLibrary() to load a DLL rather than linking it, as this would not be picked up automatically by the Choose Exe... method.

 

By default, all the modules are ticked in the yellow checkboxes.

 

Any DLLs in the list override the DLL Hook Insertion settings on the Hook Insertion tab.

 

noteNote that ticked modules or folders are either included or excluded depending on the hooking rule above

 

 

Altering existing module names

 

Although you can't add blank entries to the list and edit them, you can edit existing items in the list by double clicking on an entry:

 

enter only the module name, not the path

you can use wild-cards like MFC*.dll, but only for DLLs, not folders

 

 

Managing the process modules list

 

The usual controls apply for removing or changing the enabled state of items in the list:

 

Remove instructionStep removes selected items in the list
 

Remove All instructionStep removes all items, clearing the list
 

Enable All instructionStep ticks all items in the list for applying to the hooking rule
 

Disable All instructionStep unticks all items in the list, meaning they won't apply to the hooking rule

 

Alternatively, press b_del to delete selected items, and b_ctrl + b_a to select all items in the list first.

 

 

Exporting and importing

 

Since the list of hooked DLLs (and the rule being applied) can be quite complicated to set up and optimise, you can export the settings to a file and import them again later. This is useful when switching between different target applications.

 

Export... instructionStep choose or enter a filename instructionStep Save instructionStep outputs the hooking rule and the list of modules to the file
 

Import... instructionStep navigate to an existing *.cvx file instructionStep Open instructionStep loads the hooking rule and the list of modules

 

note The exported file can also be used with the -dllHookFile command line option.

 

 

Optionally hooking delay loaded DLLs

 

Don't hook delay loaded DLLs instructionStep prevents hooking of delay loaded DLLs. The default is to hook these.

 

 

 

Launching new Applications

 

When specifying DLLs to hook, and launching different applications, it can be quite easy to forget to change the hooked DLLs for the new program. This might be the case when performing unit tests, for example.

 

Using the wrong list of hooked DLLs for a program will likely cause incorrect coverage results, so you can opt to be warned about the DLLs being hooked whenever the target application changes between sessions (using the dialog below).

 

The choices in the drop down list are only applicable when the application changes:

 

Ask about DLLs to Hook settings if some DLLs defined
 

You'll only be asked about the settings if you defined some DLLs in the list and if the hooking rule is not set to hook all DLLs

 

Always ask about DLLs to Hook settings
 

You'll always be asked about the settings - whatever the other settings are.

 

Never ask about DLLs to Hook settings
 

 

The 'Launch Different Application' dialog

 

When being asked about the hooked DLL settings, you'll see the following dialog:

 

launch-defferent-application

 

 

You can update the settings; ignore them and launch anyway, or just cancel the launch:

 

Update Settings and Launch instructionStep edit the settings instructionStep click OK instructionStep the application will be launched
 

Ignore Settings and Launch instructionStep the application will be launched without updating the settings
 

Cancel instructionStep won't launch the application
 

To change when you are asked this question, just choose the appropriate option in the dialog.

 

 

Advanced options

 

There are a few system DLLs which are generally not much use when hooked for code coverage.

 

The source code for these DLLs is unlikely to be available, and even if it is, your application is unlikely to be able to influence the code coverage.

 

Consequently, by default these system files are not hooked - unless you override that by specifically including them in the process modules list above.

 

With the advanced options below, you can change this behaviour if you need to, letting you specify which DLLs will be processed according to the rules for Source Code Line Hook Insertion.

 

Advanced instructionStep shows the Hooked DLLs (Advanced) dialog for function and line profiling

 

hooked-dlls-advanced

 

In the Hooked DLLs (Advanced) dialog:

 

Use the Hooked DLL settings... instructionStep if selected then only the general settings apply (i.e. those on the Hooked DLLs tab)
 

Use these default DLL settings... instructionStep if selected then the checkboxes control the default behaviour for the relevant DLLs
 
       The default is not to track functions in files in the following:

 

MFC DLLs... instructionStep check to cover MFC*.DLL or leave unchecked to ignore
 

MSVC DLLs... instructionStep check to cover MSVC*.DLL or leave unchecked to ignore
 

STL support DLL... instructionStep check to cover MSVCP*.DLL or leave unchecked to ignore
 

the system directory... instructionStep check to cover anything in C:\WINDOWS\SYSTEM32 or leave unchecked to ignore them
 

Reset instructionStep resets the settings in the dialog

 

 

Reset All - Resets all global settings, not just those on the current page.

 

 

Reset - Resets the settings on the current page.