Last update March 7, 2012

Reference For Tools /
Cscope



Difference (last change) (no other diffs, normal page display)

Deleted: 45,155d44
jam tangan
jam tangan murah
jam tangan kw
hostgator coupon
kata mutiara
Jasa SEO
EZido
RDAnet
pioneer deh-1300mp
asus a53e-xa2
asus tf101-b1
asus tf101-a1
asus n53sv-eh72
asus republic of gamers g74sx
asus acer a5250
acer chromebook ac700
asus asus 53u
lg infinia 55lw5600
Sonicview 360 premier
asus 7 cu ft freezer
asus 30 single wall oven
brother cs6000i sewing machine
brother 1034d serger
brother sewing machines
Yokohama Geolandar H/T-S
crib tent tots in mind
kidco peapod plus
foscam fi8910w
samsung pl120 review
gopro helmet cam
Canon SX130IS
powershot s100
ContourHD 1080p
canon vixia hf r21
digital picture frame
canon ef 50mm f1.4
canon ef 70-300mm review
wide angle lenses
moving comfort sports bra
moving comfort bra
womens argyle sweater
bebe dresses
ViewSonic VX2250WM
Le Pan TC 970
Apple MacBook Air MC965LL
Sennheiser CX 880
plantronics cs540
ultrasonic jewelry cleaner
Sennheiser RS120
bose quietcomfort 15 acoustic noise cancelling headphones
logitech harmony one remote
logitech harmony 900
sony mhc-ec69i
sony mhcec909ip
bose wave music system
sony htss380
logitech squeezebox touch
sony dvp-fx970
onkyo tx-nr509
onkyo tx - nr609
onkyo ht-s3400
energy 5.1 take classic home theater system
polk audio psw505
onkyo ht-s5400
onkyo tx-nr709
belkin pf60
onkyo ht-rc360
denon avr-1912
Yamaha YHT-S400BL
fujitsu scansnap s1500
brother hl-2270dw
epson workforce 545
hp laserjet p2055dn
bushnell 8mp trophy cam
toshiba 32c110u
panasonic viera tc-p60s30
VIZIO E220VA
hauppauge wintv dcr-2650
Acer AM3970-U5022
Acer AspireRevo AR3700-U3002
Dell Inspiron i570
Dell GX620
Gateway FX6860-UR20P
Western Digital My Passport Essential SE 1 TB USB 3.0
Fujitsu ScanSnap S1300
Epson Perfection V300
Fujitsu SCANSNAP S1100
NeatDesk Desktop Scanner and Digital Filing System
Epson WorkForce Pro GT-S50
Kodak P811BK
Epson Perfection V330
Viewsonic VX2453MH
Asus VE228H
ViewSonic VA2431WM
Samsung B2230
HP 2711x
ASUS ML228H
Epson PowerLite Home Cinema 8350
Optoma PK301
Epson EX7210
Epson EX5210
ViewSonic PJD5133
Acer X1161P
FAVI RioHD-LED-2
Epson EX3210
ViewSonic PJD6531w
Trinity 360 Breville 800JEXL
Skil 3320-02
Delta 46-460
Grizzly G0555
Delta 18-900L

Download cscope from either the official website, or if you're using Windows get it from here.

Cscope can be used directly by calling it from a shell, but it's much easier to use it from an editor's interface, which is described in this guide (Vim is an example of an editor that comes with built-in support for Cscope).

The necessary steps for building a cscope database are:

  • 1. Collect a list of filenames for the database and store the list into the file cscope.files. You should be careful not to add any non-sourcecode or version control files to the list. The source files do not need to have the full path listed in the output file.
  • 2. Call Cscope from within the same directory as the file cscope.files to build the database.
  • 3. Use the newly built cscope.out database file in your favourite editor/IDE that supports Cscope.
Detailed instructions (These are specific to Windows and Vim, but they should be easily adaptable to other platforms and tools):
  • 1. Use a good find tool to get a list of source files and output the list to a file called cscope.files. ack is a good tool for this.
      • Quick ack install guide for Windows: Get and install Strawberry Perl, add the executables to the PATH, and then issue this call in a command-prompt:
      • perl -MCPAN -e "CPAN::Shell->force(qw(install App::Ack));"
    • The ack command to get all the C++ and D files recursively from the current directory is:
      • ack -f --type-set D=.d,.di -D --cpp > cscope.files (Read the ack documentation for details on these arguments)
  • 2. Build the Cscope database by calling:
    • cscope -b in the same directory as cscope.files.
  • 3. Use the instructions that come with your editor/IDE to add and link to the Cscope database. In Vim you can use this command:
    • :cscope add %:p:h - Note that "%:p:h" expands to the current working directory in Vim. Otherwise replace this with the location of the file cscope.out, or the directory it resides in.
Automating usage of Cscope in Vim (Windows-specific, but adaptable to other platforms)

I've installed the Shell.vim plugin: http://peterodding.com/code/vim/shell/ , which enables calling external shell commands without blocking Vim and without popping up of the command-prompt. I have these lines in my _vimrc file: http://pastebin.com/4FUUcNLu . I also have a batch file buildcscopetags.bat in my PATH with the line:

  • ack -f --type-set D=.d,.di -D --cpp > cscope.files && cscope -b
Now all I have to do is use ,t in a Vim buffer and I will have a newly built and added cscope database with all the C++ and D files found in the directory (and any subdirectories) of the current file. I can place my cursor over a function name and use Ctrl-] to find all the functions that call the function under the cursor. There are many other find commands that can be automated.

Use :h cscope in Vim for additional details on using Cscope. You might also want to try some Vim front-ends that work with Cscope (and Ctags): Vim Cscope Search


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: March 7, 2012 20:41 (diff))