JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: C User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information

Preface

1.  Introduction to the C Compiler

2.  C-Compiler Implementation-Specific Information

3.  Parallelizing C Code

4.  lint Source Code Checker

5.  Type-Based Alias Analysis

6.  Transitioning to ISO C

7.  Converting Applications for a 64-Bit Environment

8.  cscope: Interactively Examining a C Program

8.1 The cscope Process

8.2 Basic Use

8.2.1 Step 1: Set Up the Environment

8.2.2 Step 2: Invoke the cscope Program

8.2.3 Step 3: Locate the Code

8.2.4 Step 4: Edit the Code

8.2.5 Command-Line Options

8.2.6 View Paths

8.2.7 cscope and Editor Call Stacks

8.2.8 Examples

8.2.8.1 Changing a Constant to a Preprocessor Symbol

8.2.8.2 Adding an Argument to a Function

8.2.8.3 Changing the Value of a Variable

8.2.9 Command-Line Syntax for Editors

8.3 Unknown Terminal Type Error

A.  Compiler Options Grouped by Functionality

B.  C Compiler Options Reference

C.  Implementation-Defined ISO/IEC C99 Behavior

D.  Features of C99

E.  Implementation-Defined ISO/IEC C90 Behavior

F.  ISO C Data Representations

G.  Performance Tuning

H.  Oracle Solaris Studio C: Differences Between K&R C and ISO C

Index

8.1 The cscope Process

When cscope is called for a set of C, lex, or yacc source files, it builds a symbol cross-reference table for the functions, function calls, macros, variables, and preprocessor symbols in those files. You can then query that table about the locations of symbols you specify. First, from a menu you choose the type of search you would like to have performed. You might, for instance, want cscope to find all the functions that call a specified function.

When cscope has completed this search, it prints a list. Each list entry contains the name of the file, the number of the line, and the text of the line in which cscope has found the specified code. The list can also include the names of the functions that call the specified function. You then have the option of requesting another search or examining one of the listed lines with the editor. If you choose the latter, cscope invokes the editor for the file in which the line appears, with the cursor on that line. You can then view the code in context and edit the file as any other file. You can then return to the menu from the editor to request a new search.

Because the procedure you follow depends on the task at hand, no single set of instructions is relevant for using cscope. For an extended example of its use, review the cscope session described in the next section, which shows how you can locate a bug in a program without learning all the code.