Using Sun WorkShop

Using Source Browsing

To use source browsing:

  1. Compile the application using the -sb or -xsb option, which instructs the compiler to generate a browsing database during compilation.

    (See "Generating a Browser Database".)

  2. Choose Browse > Browse Sources, or click the Browsing button in the Sun WorkShop main window tool bar, and then click the Source Browsing radio button in the Browsing window.

  3. Look in the Browsing window title bar to be sure you are in the correct browsing directory.

    If not, choose Browse > Change Browsing Directory and use the Browsing Directory dialog box to select the directory that contains the source browser database.


    Note -

    You can search files in multiple directories in the browsing database. See "Searching Multiple Directories".


  4. Type a query in the Match text box and press Return, choose Query > Find Matches, or click the Find Matches button.

    For details on writing a query, see "Composing a Query".

  5. Restrict the number of matches returned by choosing a match, type, or scope from the appropriate pulldown list.

    For information on the lists, see "Browsing Window in Source Browsing Mode". For detailed information on restricting a query, see "Restricting a Query" in the Sun WorkShop online help.

  6. Move through the Match pane using the mouse, the Next Match and Previous Match buttons or menu items, or by pressing F5 and Shift+F5.

    Each match line contains the name of the source file, the line number, and the text on that line. Matches are sorted with definitions first, declarations last, and everything else in between. Within each group, the matches are listed alphabetically by file name, then by line number.

  7. Click a match to view the source in the editor window.

  8. Start the Call Grapher, Class Grapher, or the Class Browser to view relationships in the source.