Using the Address Query dialog below, you can search the data for allocation events at or near an address.
Searches can include:
•allocations in a memory block of a certain size, starting at an address of your choice
•allocations within a specified range of a chosen address (+/-)
To show the Address Query dialog, choose the menu option below:
Or use the following icon on the Query Toolbar.
The search address is essential, but size and range are optional for adding some tolerance.
The format of these values can be decimal or prefixed with 0x for a hexadecimal address.
•Address to search for enter the memory address of interest
•Size choose a size of memory block within which to search for allocations
•Address within range enter a tolerance range for finding allocations near to the address
The range can help find potential candidates for memory overrun, underrun and corruption problems.
As well as allocations you can search for reallocations and/or free events:
•Allocated search for allocations
•Reallocated search for reallocations
•Deleted search for free events
•Query performs the search
The search results are added to the list in the dialog.
•Clear clears all the results from the list
The list is not automatically cleared with each search, so you can compare results of different searches
The search results may be shown in the following sections if you entered any of the optional criteria:
•results including the address
•results within the size, if specified
•results within range, if specified
You can specify decimal values and hexadecimal values for your search query.
For example, when searching for address 0x037e6120 with a size of 30 and a range of 0x1000:
Results appear in the earliest of the above sections. They are not repeated in the case where the size and the range might capture overlapping results.
You can expand the search results, and double click the data items to edit source code in your preferred editor.
As well as finding an object at an address, you can find which objects it may reference and which objects may reference it:
•Addr Ref'd... find other objects which are referenced by the object at the search address
•Addr Ref'ing... find other objects that reference the object at the search address
Similarly, within the main search results, you can select an item and find potentially referenced and referencing objects:
•Referenced... find other objects which are referenced by the selected object
•Referencing... find other objects that reference the selected object
The target program must still be executing for references to be found. You wouldn't be able to find references in a session that has been loaded from a file.
Referenced and referencing pointers are listed in a new dialog.
•Update refresh the results
You can keep several of these dialogs open if you want to compare results.
You can double click a row in the Referencing Pointers dialog to edit source code if its available.
It's normal for there to sometimes be a pause before referenced objects are displayed. This is while the data is being found.
The following popup menu is available over the data area
Click on any part of the menu to jump straight to the topic below:
•Edit Source Code... view the source code in the source code editor
•Referencing Pointers... view pointers referencing the selected address
•Referenced Pointers... view pointers referenced by the selected address
•Show Data at (bytes)... view the contents of memory at the selected address
•Relations a submenu of additional queries related to the current allocation
The relations menu has a large sub-menu with many different options for choosing a set of related data to display in the upper analysis window.
Think of this as a sub-query on the working data - like searching for friends of friends on a social network!
Available relations are as follows, with allocations generally meaning any allocation, reallocation or deallocation
Finds any other allocations on the same memory address (allocations, reallocs, or frees)
Allocations on any memory objects of identical size
or on smaller
or larger objects
•Same object type
Finds any other allocations of the same type
•Same source file
All allocations from the same file...
or the same DLL
For memory allocations, finds all other allocations within a range of 32 bytes up to 4Kb of this one
Getting an address to search for
Memory Validator has an example program with which to safely explore all the features available.
While the example program is running, refreshing the Memory Tab view should show an allocated object of type CSingleDocTemplate:
Address to search for
Using the Query Address dialog to search for that object's address and size (address 0x0060A10, size 140 in this case) should show the expected result:
Expanding the size to 0x100 may find more objects. For example:
Additionally, setting the range to 0x1000 might give the result:
Clicking Addr Ref'd to find referenced objects should include CTeststakDoc being referenced by the CSingleDocTemplate :
Clicking Addr Ref'ing to find objects referencing the object at the address 0x0231BD50 might show something like: