Install cssag and Ctags in Ubuntu

Source: Internet
Author: User
1. Click here to download the Cscope software. Tar-jxvfcscope-15.7a.tar.bz2cdcscope-15.7a./configuremakesudomakeinstall installation process problems: 1. The 'flex 'ismissingonyoursystem: sudoapt-getinstallflex2 appears.

1. Install cssag Software

Click here to download the Cscope software.

Tar-jxvf cscope-15.7a.tar.bz2

Cd cscope-15.7a

./Configure

Make

Sudo make install

Problems during installation:

1. 'flex 'is missing on your system: sudo apt-get install flex appears.

2. the command "sudo apt-get install byacc" is not found.

3. the following error occurs: sudo apt-get libncurses-dev.

-------------------------- Split line --------------------------

1: add the cscope function to the cscope according to the cscope reference manual in vim (execute the ": help cscope" command in vim. after vimrc (you need to select the "-enable-cscope" option DURING vim compilation; otherwise, you need to re-compile vim), the configuration is complete. Then, use the following command to generate the symbol index file of the Code;

2: Go to the corresponding kernel source code directory;

3: cs1_rbkq

This command generates three files: csexample. out, csexample. in. out, csexample. po. out.

Cssag. out is the basic symbolic index, and the last two files are generated using the "-q" option, which can speed up the cssag index.

The command parameters used above have the following meanings:

-R: Search for the code in the subdirectory tree when generating the index file

-B: Only the index file is generated, and the cssag interface is not displayed.

-K: when the index file is generated, the/usr/include directory is not searched.

-Q: generate the cssag. in. out and cssag. po. out files to speed up the cssag index.

Next, you can read the code in vim.

However, during use, it is found that the class, function definition, and call relationship of C ++ cannot be found. After carefully reading the cssag manual, we found that when cssag generated index files, only files of the C, lex, and yacc types were searched (with the suffix. c ,. h ,. l ,. y), the C ++ file does not generate an index at all. However, according to the instructions in the manual, cssag supports c ++ and Java files.

Therefore, according to the methods provided in the cssag manual, a file list is generated first, and then cssag generates an index for each file in the list.

For ease of use, I wrote the following script to update the index files of cssag and ctags:

#! /Bin/sh

Find.-name "*. h"-o-name "*. c"-o-name "*. cc"> cscope. files

Cscope-bkq-I cscope. files

Ctags-R

2. Install the Ctags Software

Ctags:

(1) Installation

Http://ctags.sourceforge.net/

In Ubuntu, apt-get can be used for installation:

Sudo apt-get install ctags

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.