Debugging Memory Problems with MemoryScape : Chapter 2 Memory Tasks : Task 10: Filtering Reports : Adding and Editing Filters

Adding and Editing Filters
After you click the Add button in the Memory Debugging Data Filters dialog box, MemoryScape displays the Add Filter dialog box. Similarly, clicking the Edit button in the Memory Debugging Data Filters Dialog Box tells MemoryScape to display a nearly identical window, Figure 67.
 
The controls in this window are as follows:
Filter name
Enter the name of the filter. This name will appear in the Memory Debugging Data Filters dialog box.
In Figure 67, notice that one filter is named “Function Name contains myClassB::init”. This is the name created by MemoryScape when you use the context menu to add a function name. Similarly, this is why you see a filter named “Line Number = 8”.
Share filter
Selecting this button tells MemoryScape that you are creating a filter that will be shared. Shared means that anyone using MemoryScape can use the filter.
Add
Clicking this button tells MemoryScape to add a blank line beneath the last criterion in the list. You can now enter information defining another criterion for this filter within this new line.
Remove
Deletes the selected criterion. To select a criterion, select the number to the left of the definition.
Up and Down
Changes the order in which criteria appear in the list. As MemoryScape applies criteria in the order in which they appear in this list, you should place criteria that remove the most entries at the top of the list. As filtering can be a time-consuming operation, this can increase performance.
Exclude data matching
If you have more than one criterion, the selected radio button indicates if any or all of the criteria have to be met.
any of the following
When selected, MemoryScape removes an entry when the entry matches any of the criteria in the list.
all of the following
When selected, MemoryScape only removes a memory entry if it fulfills all of the criteria.
Evaluate
When evaluating a filter, you can limit which backtraces MemoryScape looks at.
allocation focus entry only
When selected, MemoryScape only removes an entry if the criteria you set is valid on an entry that is also the allocation focus.
The allocation focus is the point in the backtrace where MemoryScape believes your code called malloc().
For example, if you define a filter condition that says Function Name contains my_malloc and set this entry to allocation focus entry only, MemoryScape only removes entries whose allocation focus contains my_malloc. That is, it only removes allocations that originated from my_malloc.
In contrast, if you set this entry to all backtrace entries, MemoryScape removes all blocks that contain my_malloc anywhere in their backtrace.
all backtrace entries
When selected, MemoryScape applies filter criteria to all function names in the backtrace.
Criteria
A filter is made up of criteria. Each criterion tells MemoryScape what it should eliminate from the list. Each criterion has three parts: a property, an operator, and a value. For example, you can look for a Process/Library Name (the property) that contains (the operator) strdup (the value).
Property
When evaluating an entry, MemoryScape can look at one of eight properties for one criterion, Figure 68. Select one of the items from the pulldown list. These items are:
Operator
Indicates the relationship the value has to the property., Figure 68. Select one of the items from the pulldown list. If the property you’ve selected is a string, MemoryScape displays the following list: 
 
 
If the item is numeric, it displays the following list:
Value
Type a string or a number that indicates what MemoryScape will compare.
 

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com