Filter using filename and line number

This tutorial assumes that you have read the memory leak tutorial about detecting memory leaks and that you have built the sample application. If you have not done this, please do so before continuing with this tutorial. 

This tutorial demonstrates how to prevent the display of data allocated at a specific filename and line number, by using a filter to control the data on the display. The filter can be inverted, thus converting the filter from “display anything not matching this filter” into “only display items matching this filter”.

  • Start your program using Memory Validator’s launch program option.Memory Validator launch toolbarThe launch application wizard displayed.Memory Validator launch wizard

    Select [installdir]\nativeExample\debugNonLink\nativeExample.exe using the Browse… button. Accept all default settings and move through all pages of the wizard to the last page. Click the Start Application button.

     

  • Use nativeExample.exe as normal.
  • Using Memory Validator, select the Memory tab and click Refresh. The display will show all allocations made by the application that have not been deallocated. The display will look similar to this:Memory Validator filter by file and line number
  • Click on an entry with the right mouse button. A context menu will appear. Using the Local Filters popup select Custom Filter….Memory Validator Context menu custom filterThe custom filter dialog will be displayed.Memory Validator custom filter dialog
  • Select the Match Using File And Line radio box.
    Using the combo box, select the filename and line number you want to filter.
    The custom filter dialog should look similar to this image below:Memory Validator custom filterClick OK to accept the filter definition. The Memory tab display automatically updates.

    Memory Validator filter by file and line number

  • As you can see, the display does not show any entries for the filename and line number chosen. You can create as many filters as you desire.
  • If you wish to change the filtering effect so that you see the data the filter selects and do not see the data the filter ignores, you can edit the filter and then check the Invert Filter check box at the bottom of the dialog. This option makes the filter display matches rather than hide matches.To edit the local filters.
    • Click on the Filter… button.
    • Double click on the filter in the list to display the filter definition dialog. Alternatively select the filter, then click the Edit… button.
    • Modify the filter and click OK or Cancel as appropriate.
    • Edit any other filters.
    • To see the effect of the filter, click Apply.
    • To accept the filters, click OK.
    • To discard the filter edits, click Cancel.

    To edit Global or Session filters you must use the Filter Manager, available from the toolbar or the Managers menu.

     

  • Local filters affect data displayed on their display tab.
  • Session filters affect data displayed for a particular session.
  • Global filters affect data in all sessions on all displays.

Fully functional, free for 30 days