Generating a Browser Database

Related Topics:

Creating a Tags Database Pattern Search and Source Browsing
Browsing Multiple Directories
Starting Source Browsing

When you compile your source files with a source browser option, the Sun WorkShopTM programming environment creates a database containing information about the files. Once the compiler-generated browser database is created, you can use all the browsing features of Source Browsing Mode in the Browsing Window. The Source Browser responds to queries by searching through this database.

To ask Sun WorkShop to generate a compiler-generated browser database when it builds your project:

1. Choose Project Edit Project in the WorkShop Main Window.

The Edit Current Project Window opens.

2. Select compiler flags by doing one of the following (depending on what type of project you are editing):

3. Click OK.

4. Choose Build Build Project.

To generate a compiler-generated browser database by changing your makefile and then building your source files:

1. Add the appropriate source browser option to your makefile.
Language

Option

C++, Fortran 77, Fortran 95 -xsb or -sb
ANSI C -xsb
Assembler -b

2. If you browse each build, add the following lines to your makefile to force the building of the browser index when a build process completes:
.DONE: query
query: -sbquery nonesuch

The symbol nonesuch is any name that does not occur in your database.

3. Build your source files.

The generated database is written to the SunWS_cache directory (or the directory set by the SUNWS_CACHE_NAME environment variable) in the build directory.


Note - The information included in the database depends on the particular compiler you are using. In general, only identifiers and strings are included; reserved words are not included.