HPlogo HP WDB-GUI Reference Manual: HP-UX 11i v2 > Chapter 3 Debugging with WDB GUI

Browsing Functions

» 

Technical documentation

Complete book in PDF

 » Table of Contents

WDB GUI makes it easy to lookup and visit functions in your source code. You can specify a regular expression filter to control which functions are listed, and you can visit the source of a listed function simply by clicking on the name in the list.

The function browser is in the tool bar at the top of the debugger’s main window.

Viewing source for a function

The most direct way to view source for a function is to:

  1. In the Function To Visit text box, type the function name.

  2. Press RETURN. Source for the function will be displayed in the Source View.

Alternatively, if you’ve entered a function filter, you can select the function to view by clicking on the Function Matches button and selecting from the resulting list of functions. You can also select from a list of recently viewed functions by clicking on the Recent Functions button.

Specifying a function filter

Specifying a function filter is useful if you don’t recall the exact name of a function, or if you want to view source for a number of similarly named functions. For example, if you want to view various functions with the string “foo” in their names, do the following:

  1. Type “foo” in the Function Lookup Filter text box.

  2. Press RETURN. The status area at the bottom of the debugger window shows the number of matches.

  3. Click the Function Matches button and choose from the list of functions. Given the filter “foo”, the functions “foobar”, “barfoo”, and “barfoobar” would all be listed as function matches.

You can reuse a previously entered function filter by clicking on the Recent Filters button.

Function filters are regular expressions. This allows you to, for example, precede an expression with ‘^’ to match the beginning of a function name, or follow the expression with ‘$’ to match the end of a function name.

NOTE: Unless you specify otherwise, “.*” is assumed to precede and follow the filter you enter. Examples:
  • “foo” is equivalent to “.*foo.*”

  • “^foo” is equivalent to “^foo.*”

  • “foo$” is equivalent to “.*foo$”

Listing and viewing member functions

You can list all the member functions of a particular class by entering the class name followed by “::” in the Function Lookup Filter text box. You can then view the source for member functions by choosing the desired member function from the Function Matches list.

For example, to list function members of class Shape, you would enter “Shape::” in the Function Lookup Filter text box. You could then view the source for member functions of Shape by clicking on the Function Matches button and then selecting the member function of interest.

Tips

  • When starting a debugging session, try selecting the Recent Filters and Recent Functions buttons. Both recent function lookup filters and recently viewed functions are saved between debugging sessions.

  • To specify how many filters and functions are saved across sessions, see Setting Debugger Preferences.

© 2004-2005 Hewlett-Packard Development Company, L.P.