Smattr / clink

a modern re-implementation of Cscope
The Unlicense
46 stars 2 forks source link

[Feature] Export clink.out with cscope symbol database format #48

Open pidgeon777 opened 2 years ago

pidgeon777 commented 2 years ago

Many useful tools utilize the cscope output database for further code processing/searches.

It would be a great addition for your tool to export a clink.out file with the same format of the cscope symbol database.

More info follows here, section Symbol Database Format:

https://codecat.tistory.com/entry/cscope-manpage

Smattr commented 2 years ago

Can you give an example of something other than Cscope itself that consumes the Cscope database format? Its format has a number of shortcomings which directly motivated not reusing the same format for Clink. A related question is, if you want to produce a Cscope database, why not use Cscope itself?

pidgeon777 commented 2 years ago

Actually, here are some of the most useful C\C++ source code analyzers which make use of the cscope database:

  1. https://sites.google.com/site/vimcctree/

Vim plugin which builds a symbol tree for code navigation.

  1. http://ruben2020.github.io/codequery/

A great GUI and command-line tool for code navigation.

  1. https://sourceforge.net/projects/tceetree/

Extremely useful for visualizing the source code structure.

It would be great for your tool to generate a cscope.out database file, as an export option.

A related question is, if you want to produce a Cscope database, why not use Cscope itself?

Because cscope would be more limited in C\C++ code parsing.

Anyway, my suggestion was not to replace your clink internal database format, but to allow a user to export it in cscope format, for the reasons expressed above.

Smattr commented 2 years ago

It's certainly possible. A Python script using pycscope would probably be reasonably straightforward for this.