Re: [cedet-semantic] how to test/debug semanticdb-global?
Brought to you by:
zappo
From: Eric M. L. <eri...@gm...> - 2011-09-10 12:42:25
|
On 09/09/2011 05:37 PM, David Ventimiglia wrote: > Hi! > > I thought that Semantic could use a GNU Global database as a back end > when doing database searches for tags, and I thought that would mean > it would be able to get tags for any include file in my project. > However, that seems not to be happening. My particular use-case > involves a Java project, which comprises a Java source directory > hierarchy with one root in $HOME/work/src, where that directory has > been added to semanticdb-project-roots. In addition, I've enabled the > use of GNU Global for Java projects with > (semanticdb-enable-gnu-global-databases 'java-mode) in my .emacs file. > Finally, I have a GNU Global database (comprising GPATH, GTAGS, and > GRTAGS) sitting in that project root $HOME/work/src. I expected that > any `import' statement in any given Java file in that directory > hierarchy, which refers to a Java class in some other package > belonging to the same hierarchy, would be found by semantic, > regardless of whether the target file for the `import' statement had > been parsed by semantic. I expected it would just get the tags from > Global. However, I'm not getting that behavior. Instead, it > highlights the `import' statement as an "Unknown Include" (I have > excessive code helpers turned on), and it only becomes a "Known > Include" if I browse to the target file for the `import', open it in a > buffer, and have Semantic parse it. > > Question. How do best do I troubleshoot this? There are a bunch of debug helpers to look into current semantic state. One of which is: M-x semanticdb-dump-all-table-summary RET Is there a GNU Global table somewhere in the list? Another is to go into a buffer, and do: M-x semanticdb-find-test-translate-path RET which will list the items specifically for your buffer, and GNU Global should be in that list. Lastly, if none of that shows something from GNU Global, then in one of your buffers, do: M-x cedet-gnu-global-version-check RET to see if you have the right stuff, then M-x semanticdb-test-gnu-global RET symname RET and see what it finds. If it returns something unexpected, perhaps you have gnu global sources in ~/src where that last one goes by default if global isn't working for a local buffer. Eric |