How to make emacs Semantic use a TAG file created by GTAGS

My emacs version is 23.2.1, although I used the following to change the backend to use GTAGS. (requires "semantic / db-global") (c-mode semanticdb-enable-gnu-global-databases) (semanticdb-enable-gnu-global-databases' C ++ - mode) I tried to create a GTAGS file that will be used as the basis of semantics. However, every time I open a C file, Semantic still processes the files without using the GTAGS file.

  • Can I use a GTAGS file instead of the built-in semantics analyzer? I found that the built-in parser is not very accurate.

  • Can I use a GTAGS file without specifying a project area? In my case, I tried to put the GTAGS file in / usr / include, which should be standard, include the emacs path. But Semantics does not use it.

+7
emacs cedet gnu-global emacs-semantic
source share
1 answer

Semantic does not use the GTAGS file to generate tags that it will use directly for features such as jump or smart completion. The GNU Global backend for semantic db will use GTAGS instead as a giant name table. Thus, if you need to find a character by name, GTAGS will determine the semantics where it is, and Semantic will then analyze these files more directly to get the details.

The reason GTAGS is not used directly because the replacement parser is used because the information in GTAGS is insufficient for the types of operations that semantics need is because it excludes data type information, argument parsing, and local context analysis.

Using gtags in / usr / include is an interesting idea, but probably won't be used. Semantic will search for header files that are actually used in your code, instead of searching for all included files. The GNU Global backend is specifically designed to scan an entire project for a symbol or symbol reference. If you want to search all your characters for a character, then that would be useful, but there is currently no such function in Semant.

You can use ebrowse to do what you want, but I found that for C ++ the parser was not a subtle way and caused some problems.

If you think the semantic parser is inaccurate, you should post it as an error on the cedet-devel mailing list.

+7
source share

All Articles